Displaying 1 result from an estimated 1 matches for "lagpolity4ap3".
Did you mean:
lagpolity4ap1
2012 Nov 01
2
Subsetting year range
...wrong.
Thanks,
Full code:
###########
TableAP <- read.csv("AnnualPanel.csv")
TableAP <- data.frame(TableAP)
TableAP
nrow (TableAP)
install.packages("zoo")
require(zoo)
Lagpolity4AP1 <- lag(zoo(TableAP$polity4), -1)
Lagpolity4AP2 <- lag(zoo(TableAP$polity4), -2)
Lagpolity4AP3 <- lag(zoo(TableAP$polity4), -3)
Lagpolity4AP4 <- lag(zoo(TableAP$polity4), -4)
Lagpolity4AP5 <- lag(zoo(TableAP$polity4), -5)
LaglrgdpchAP1 <- lag(zoo(TableAP$lrgdpch), -1)
LaglrgdpchAP2 <- lag(zoo(TableAP$lrgdpch), -2)
LaglrgdpchAP3 <- lag(zoo(TableAP$lrgdpch), -3)
LaglrgdpchAP4...