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 meanComparisonWithControlVar2.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=%23+Chapter+5%3A+Making+Controlled+Comparisons%0Alibrary%28poliscidata%29++%23+Loads+R+companion+package+in+session%0A%0A%23+MEAN+COMPARISON+ANALYSIS+WITH+A+CONTROL+VARIABLE+%0A%0Acat%28%22Controlled+Mean+Comparison+Table%3A%5Cn%22%29%0AimeansC%28%7Emodsex_scale%2C+%7Elink_wom_scale+%2B+dem_raceeth2%2C+nesD%29%0A%0A%23+Next+commands+create+plot+with+legend%0AiplotC%28%7Emodsex_scale%2C+%7Elink_wom_scale%2Bdem_raceeth2%2C+nesD%2C%0A+++++++modsex_scale%7Edem_raceeth2%2Blink_wom_scale%2C%0A+++++++xlab%3D%22Linked+Fate+Scale%22%2C+ylab%3D%22Modern+Sexism+Scale%22%2C%0A+++++++main%3Dlist%28%22Modern+Sexism+Opinions+by+%5Cn+Linked+Fate+and+Race%22%2C+cex%3D1.2%29%29%0Alegend%28%22topleft%22%2C+legend%3Dc%28%22Black%22%2C%22White%22%29%2C+lty%3Dc%282%2C1%29%2C+lwd%3D2%2C+%0A+++++++title%3D%22Race%22%2C+inset%3D0.1%2C+bty%3D%22n%22%29"></iframe>
<!-- End of meanComparisonWithControlVar2.txt R Demo Code -->