POL 300: Lab 3

Author

Dr. Annie Karreth

This page contains R code for Lab 3.

Instructions

To complete this lab:

  • create a new R script on your computer
  • save it under the name POL 300 Lab 2.R
  • copy and paste the code from this page (in the gray boxes) into the script
  • comment the code as instructed during the lab

Code

library(RCPA3)
setwd(dirname(rstudioapi::getSourceEditorContext()$path))
getwd()
sortC(id=country, by=infant.mortality, data=world, limit=5)

sortC(id=country, by=infant.mortality, data=world, limit=5, descending=F)

sortC(id=country, by=fh.democ.3cat, thenby=gdp.percap, data=world, limit=10)
crosstabC(dv=abortlaws.3cat, iv=religiosity3, data=states)

crosstabC(dv=abortlaws.3cat, iv=religiosity3, data=states, chisq=T)

crosstabC(dv=frac.eth2, iv=election.violence.post, data=world, chisq=T)
compmeansC(dv=coup.attempts, iv=dpi.system, data=world)

```