research paper using R
PSC 370 American Judicial Politics Data Lab #1
1
(1) Generate between 5-10 hypotheses for your justice. (2) Go to Blackboard
• Download your justice data file (clark.dta) o Create a new folder (psc 370 project) o Save justice data file in “psc 370 project”
• Download the Codebook o Save it in “psc 370 project”
Open R Misc > Change Working Directory Select folder (“psc 370 project”) Install R Packages #only need to do this once install.packages(“car”) install.packages(“descr”) install.packages(“readstata13”) Turn On R Packages Packages & Data > Package Manager Click on “car”, “descr”, “readstata13” Or library(car) #check that they’re installed using Package Manager library(descr) library(readstata13) Read Data into R data<-read.dta13(“clark.dta”) #may need to manually type this in #ignore warning messages Names of Variables names(data) #this lists all of the variables in your dataset
#notice the similarities/differences in names of variables freq(data$issueArea) #A14 Issues Areas in Codebook is issueArea in R #combines all issues into 14 broad areas #notice the frequencies (number of cases) in each category freq(data$issue) #A13 Issues in Codebook is issue in R #a large variety of issue areas #notice the frequencies (number of cases) in each category (3) Connect your hypotheses with the data by identifying where and how those variables are located in the Supreme Court Database.