# Code examples for beginners

If you want to run a regression. Using the sample data from Mankiw :

Model 1: OLS, using observations 1-121 (n = 105) Missing or incomplete observations dropped: 16 Dependent variable: gdp85

coefficient std. error t-ratio p-value --------------------------------------------------------- const 3852.68 466.192 8.264 5.14e-13 *** gdp60 0.445227 0.0540057 8.244 5.69e-13 ***

Mean dependent var 5502.638 S.D. dependent var 5531.722 Sum squared resid 1.92e+09 S.E. of regression 4314.432 R-squared 0.397537 Adjusted R-squared 0.391688 F(1, 103) 67.96485 P-value(F) 5.69e-13 Log-likelihood −1026.800 Akaike criterion 2057.599 Schwarz criterion 2062.907 Hannan-Quinn 2059.750

Warning: 'inv' shadows a function of the same name

Data from N. Gregory Mankiw, David Romer and David N. Weil, "A contribution to the empirics of economic growth," Quarterly Journal of Economics, May 1992, pp. 407-437

Cross-country data from 1960 and 1985 with average growth rates of GDP and population of working age, the average ratio of investment to GDP, and the percentage of the working-age population in secondary school.

Note by Allin Cottrell: These data are taken from Appendix to the paper. I believe they do not correspond exactly to the data used in the regressions reported in the paper, since I am unable to reproduce those results exactly (the differences are minor but noticeable).