Copy HTML to Run R Code ExampleAbout This Page
This page displays HTML code you can use to embed a live demonstration of the R Statistics Program for political science research.
These live online examples are easy to use and are great for teaching online classes.
<!-- The Start of creatingAdditiveIndex.txt R Demo Code -->
<!-- Copy and paste this snippet into your web page -->
<!-- Modify border, width, and height attributes of the iframe as necessary -->
<iframe border=0 width=100% height=1200 src="https://rdrr.io/snippets/embed/?code=library%28poliscidata%29++%23+run+every+time%0A%0A%23+indicator+variable+created+for+each+abortion+variable%0A%23+this+is+going+to+run+without+console+output%0Agss%24abdefect.n++++%3D+as.numeric%28gss%24abdefect%3D%3D%22YES%22%29%0Agss%24abhlth.n+%09%3D+as.numeric%28gss%24abhlth++%3D%3D%22YES%22%29%0Agss%24abnomore.n%09%3D+as.numeric%28gss%24abnomore%3D%3D%22YES%22%29%0Agss%24abpoor.n+%09%3D+as.numeric%28gss%24abpoor++%3D%3D%22YES%22%29%0Agss%24abrape.n+%09%3D+as.numeric%28gss%24abrape++%3D%3D%22YES%22%29%0Agss%24absingle.n%09%3D+as.numeric%28gss%24absingle%3D%3D%22YES%22%29%0Agss%24abany.n+%09%3D+as.numeric%28gss%24abany+++%3D%3D%22YES%22%29%0A%0A%23+individual+indicators+added+together+to+create+0-7+scale%0A%23+this+does+not+create+console+output%0Agss%24abortion.scale+%3D+gss%24abdefect.n+%2B+gss%24abhlth.n+%2B+gss%24abnomore.n+%2B++%0A++gss%24abpoor.n+++%2B+gss%24abrape.n+%2B+gss%24absingle.n+%2B+%0A++gss%24abany.n%0A%0A%23+describe+the+additive+index+to+see+results%0Acat%28%22Frequency+Distribution+Table%3A%22%29%0AfreqC%28gss%24abortion.scale%2C+gss%24wtss%29%0A"></iframe>
<!-- End of creatingAdditiveIndex.txt R Demo Code -->