# Example 11.6, Fertility Equation # Data set: fertil3 # Function for result reporting source("_report.R") # Load the data and estimate the models in the background load("fertil3.Rdata") tsdata=ts(data,start=1913,frequency=1) model1=lm(cgfr~cpe,data=tsdata) model2=lm(cgfr~cpe+cpe_1+cpe_2,data=tsdata) dig1=c(3,3,3) dig2=c(3,3,3,3,3) # Describe first model cat("This example uses the general fertility rate data set that was used in Example 10.4. In the previous example, we explained gfr in terms of pe. However, the first order autocorrelations for these series are very large: ", round(cor(data$gfr,data$gfr_1,use="complete.obs"),3), " for gfr and ", round(cor(data$pe,data$pe_1,use="complete.obs"),3), " for pe. High autocorrelations suggest unit root behavior, and raise questions about the use of the usual OLS t statistics. To derive a I(0) process, we estimate the equation using first differences:", "\ncgfr = beta0 + beta1 * cpe + t", sep="") # Report results { cat("The estimated regression line is") reportreg(model1,dig1,adj=T) } # Interpretation cat("The equation suggests that an increase in pe is predicted to lower gfr contemporaneously, and this effect is not statistically significant at the 5% level. This is very different from the conclusion in Example 10.4") # Estimate second model { cat("Now we add two lags of cpe. The estimated regression line is") reportreg(model2,dig2,adj=T) } # Interpretation tsdata=ts(data[-c(1:2),],start=1915,frequency=1) # Remove first two observations to get comparable restricted model m0=lm(cgfr~cpe_2,data=tsdata) Fstat=(summary(model2)$r.squared-summary(m0)$r.squared)/(1-summary(model2)$r.squared)*(nrow(model2$model)-nrow(summary(model2)$coef))/2 p=round(pf(Fstat,2,nrow(model2$model)-nrow(summary(model2)$coef),lower.tail=F),2) cat("The coefficients on cpe and cpe_1 are small and jointly insignificant, with a p-value of ", p, ". In comparison, cpe_2 is very significant, indicating that changes in pe have a lagged effect on changes in gfr in two years, which makes more sense than having a contemporaneous effect", sep="")