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 meanComparisonWithControlVar.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%7Eft_dem%2C+%7Egender+%2B+married%2C+nesD%29%0A%0A%23+Next+commands+create+plot+with+legend%0AiplotC%28%7Eft_dem%2C+%7Egender%2Bmarried%2C+nesD%2C+ft_dem%7Emarried%2Bgender%2C%0A+++++++xlab%3D%22Gender%22%2C+ylab%3D%22Democratic+Party+Rating%22%2C%0A+++++++main%3D%22Democratic+Party+Ratings%5Cnby+Gender+and+Marital+Status%22%29%0Alegend%28%22topleft%22%2C+legend%3Dc%28%22No%22%2C%22Yes%22%29%2C+lty%3Dc%281%2C2%29%2C+lwd%3D2%2C+%0A+++++++title%3D%22Is+R+married%3F%22%2C+inset%3D0.1%2C+bty%3D%22n%22%29"></iframe>
<!-- End of meanComparisonWithControlVar.txt R Demo Code -->