A just-for-fun reproduction of the regression analysis in Table 2 of the article "Consumer Spending in China: The Past and the Future" by Jun Nie and Andrew Palmer.
The analysis regresses the consumption share in GDP (NE.CON.PETC.ZS) in selected countries against
- the young dependency ratio (SP.POP.DPND.YG),
- the old dependency ratio (SP.POP.DPND.OL), and
- the share of the population living in urban areas (SP.URB.TOTL.IN.ZS)
using a panel regression with country-fixed effects.
$ Rscript script.R
Oneway (individual) effect Within Model
Call:
plm(formula = NE.CON.PETC.ZS ~ SP.URB.TOTL.IN.ZS + SP.POP.DPND.OL +
SP.POP.DPND.YG, data = data, model = "within", index = c("Country.Code",
"Year"))
Unbalanced Panel: n=24, T=14-56, N=1091
Residuals :
Min. 1st Qu. Median 3rd Qu. Max.
-75.3000 -3.1200 0.0521 3.4000 24.9000
Coefficients :
Estimate Std. Error t-value Pr(>|t|)
SP.URB.TOTL.IN.ZS -0.280002 0.039322 -7.1208 1.972e-12 ***
SP.POP.DPND.OL 0.314218 0.095963 3.2743 0.001093 **
SP.POP.DPND.YG 0.122299 0.025076 4.8771 1.241e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Total Sum of Squares: 61995
Residual Sum of Squares: 44303
R-Squared: 0.28538
Adj. R-Squared: 0.26792
F-statistic: 141.633 on 3 and 1064 DF, p-value: < 2.22e-16
These results are within 3% or so of those in Table 2 (except for the estimated coefficient of SP.URB.TOTL.IN.ZS).