David Sichinava, Rati Shubladze
December 20, 2017
Eleventh Meeting
Now, let's load the data:
### Download it from this link: https://goo.gl/6vhv55 or ask for the flash drive
figure1 <- read.csv("figure1.csv", stringsAsFactors = FALSE)
Variable name | Definition |
---|---|
code | Country code (like 'GEO' for Georgia) |
country | Country name (like 'Georgia') |
fhpolrigaug | Freedom House score of democracy |
lrgdpch | Logged per capita GDP |
First, let's visualize relationship
ggplot(figure1, aes(x=lrgdpch, y=fhpolrigaug))+
geom_text(aes(label=code), size=2)+
geom_smooth(method="lm")+
labs(x="Log GDP per Capita (Penn World Tables)",
y="Freedom House Measure of Democracy",
title="Figure 1",
subtitle="Democracy and Income, 1990s")
Looks promising, so let's run the model:
acem <- lm(fhpolrigaug~lrgdpch, data=figure1)
summary(acem)
acem$r.squared
par(mfrow=c(2,2))
plot(acem)
mean(acem$residuals)
Now, let's load the data:
### Download it from this link: https://goo.gl/ygPv3j or ask for the flash drive
figure1 <- read.csv("figure2.csv", stringsAsFactors = FALSE)
Variable name | Definition |
---|---|
code | Country code (like 'GEO' for Georgia) |
country | Country name (like 'Georgia') |
democ | Change in Democracy |
growth | Change in Log GDP per Capita, 1500-2000 |
acem2 <- lm(democ~growth, data=figure2)
summary(acem2)
### data can be loaded from here: https://goo.gl/uWMEuc
figure3 <- read.csv("figure3.csv", stringsAsFactors = FALSE, sep="\t")
democracy <- lm(democ~consfirstaug+indcent+
rel_catho80+rel_muslim80+rel_protmg80,
data=figure3)
growth <- lm(growth~consfirstaug+indcent+
rel_catho80+rel_muslim80+rel_protmg80,
data=figure3)
democracy$residuals <- as.numeric(democracy$residuals)
growth$residuals <- as.numeric(growth$residuals)
residuals <- as.data.frame(cbind(democracy$residuals, growth$residuals))
names(residuals) <- c("democracy", "growth")
ggplot(residuals, aes(x=growth, y=democracy))+
geom_point()+
geom_smooth(method="lm")+
labs(x="Change in Log GDP per Capita, Independent of Historical Factors",
y="Change in Democracy Independent of Historical Factors",
title="Change in Democracy and Change in Income, 1500-2000",
subtitle="Conditional on Historical Factors")