### This file containts the R code to replicate the analysis of ### social policy transposition in the new member states ## 1. Upload the data and the required packages # This version of the data import requires the data to be in the clipboard: # the data is copied from the text file. Alternatively, a path can be specified. socpol <- read.table("clipboard", header=TRUE, sep="", na.strings="NA", dec=".", strip.white=TRUE) attach(socpol) library(MASS) ## 2. Summary and visual inspection of the data # Summary of the data summary(socpol) # Histogram of the dependent variable hist(Acts, nclass=15) # Plots of the dependent variable against country and time boxplot(Acts~Country) boxplot(Acts~timelab) ## 3. Statistical models # Poisson model analysis_poisson<-glm(Acts~EUP+LR+GAL+EFF+COAL+PRS+unemp, family=poisson) summary(analysis_poisson) #Negative binomial regresssions # 1. General preferences model summary(a1<-glm.nb(Acts~EUP+LR+GAL+EFF+COAL+PRS+unemp)) # 2. General preferences + country dummies summary(a2<-glm.nb(Acts~EUP+LR+GAL+EFF+COAL+PRS+unemp+Country)) # 3. Direct preferences summary(a3<-glm.nb(Acts~EMP+EFF+COAL+PRS+unemp)) # 4. Direct preferences and country effects summary(a4<-glm.nb(Acts~EMP+EFF+COAL+PRS+unemp+Country))