Introduction to Econometrics
Part 1
> N<-301049
> N
[1] 301049
> N<-N%%50
> N
[1] 49
> Deletions <-(c(N,N+35,N+70,N+105,N+140)%%50)
> N
[1] 49
> Deletions
[1] 49 34 19 4 39
> data()
> LifeCycleSavings
sr pop15 pop75 dpi ddpi
Australia 11.43 29.35 2.87 2329.68 2.87
Austria 12.07 23.32 4.41 1507.99 3.93
Belgium 13.17 23.80 4.43 2108.47 3.82
Bolivia 5.75 41.89 1.67 189.13 0.22
Brazil 12.88 42.19 0.83 728.47 4.56
Canada 8.79 31.72 2.85 2982.88 2.43
Chile 0.60 39.74 1.34 662.86 2.67
China 11.90 44.75 0.67 289.52 6.51
Colombia 4.98 46.64 1.06 276.65 3.08
Costa Rica 10.78 47.64 1.14 471.24 2.80
Denmark 16.85 24.42 3.93 2496.53 3.99
Ecuador 3.59 46.31 1.19 287.77 2.19
Finland 11.24 27.84 2.37 1681.25 4.32
France 12.64 25.06 4.70 2213.82 4.52
Germany 12.55 23.31 3.35 2457.12 3.44
Greece 10.67 25.62 3.10 870.85 6.28
Guatamala 3.01 46.05 0.87 289.71 1.48
Honduras 7.70 47.32 0.58 232.44 3.19
Iceland 1.27 34.03 3.08 1900.10 1.12
India 9.00 41.31 0.96 88.94 1.54
Ireland 11.34 31.16 4.19 1139.95 2.99
Italy 14.28 24.52 3.48 1390.00 3.54
Japan 21.10 27.01 1.91 1257.28 8.21
Korea 3.98 41.74 0.91 207.68 5.81
Luxembourg 10.35 21.80 3.73 2449.39 1.57
Malta 15.48 32.54 2.47 601.05 8.12
Norway 10.25 25.95 3.67 2231.03 3.62
Netherlands 14.65 24.71 3.25 1740.70 7.66
New Zealand 10.67 32.61 3.17 1487.52 1.76
Nicaragua 7.30 45.04 1.21 325.54 2.48
Panama 4.44 43.56 1.20 568.56 3.61
Paraguay 2.02 41.18 1.05 220.56 1.03
Peru 12.70 44.19 1.28 400.06 0.67
Philippines 12.78 46.26 1.12 152.01 2.00
Portugal 12.49 28.96 2.85 579.51 7.48
South Africa 11.14 31.94 2.28 651.11 2.19
South Rhodesia 13.30 31.92 1.52 250.96 2.00
Spain 11.77 27.74 2.87 768.79 4.35
Sweden 6.86 21.44 4.54 3299.49 3.01
Switzerland 14.13 23.49 3.73 2630.96 2.70
Turkey 5.13 43.42 1.08 389.66 2.96
Tunisia 2.81 46.12 1.21 249.87 1.13
United Kingdom 7.81 23.27 4.46 1813.93 2.01
United States 7.56 29.81 3.43 4001.89 2.45
Venezuela 9.22 46.40 0.90 813.39 0.53
Zambia 18.56 45.25 0.56 138.33 5.14
Jamaica 7.72 41.12 1.73 380.47 10.23
Uruguay 9.24 28.13 2.72 766.54 1.88
Libya 8.89 43.69 2.07 123.58 16.71
Malaysia 4.71 47.20 0.66 242.69 5.08
> ?LifeCycleSavings
starting httpd help server done
> D<-LifeCycleSavings[-Deletions,]
> attach(D)
> D
sr pop15 pop75 dpi ddpi
Australia 11.43 29.35 2.87 2329.68 2.87
Austria 12.07 23.32 4.41 1507.99 3.93
Belgium 13.17 23.80 4.43 2108.47 3.82
Brazil 12.88 42.19 0.83 728.47 4.56
Canada 8.79 31.72 2.85 2982.88 2.43
Chile 0.60 39.74 1.34 662.86 2.67
China 11.90 44.75 0.67 289.52 6.51
Colombia 4.98 46.64 1.06 276.65 3.08
Costa Rica 10.78 47.64 1.14 471.24 2.80
Denmark 16.85 24.42 3.93 2496.53 3.99
Ecuador 3.59 46.31 1.19 287.77 2.19
Finland 11.24 27.84 2.37 1681.25 4.32
France 12.64 25.06 4.70 2213.82 4.52
Germany 12.55 23.31 3.35 2457.12 3.44
Greece 10.67 25.62 3.10 870.85 6.28
Guatamala 3.01 46.05 0.87 289.71 1.48
Honduras 7.70 47.32 0.58 232.44 3.19
India 9.00 41.31 0.96 88.94 1.54
Ireland 11.34 31.16 4.19 1139.95 2.99
Italy 14.28 24.52 3.48 1390.00 3.54
Japan 21.10 27.01 1.91 1257.28 8.21
Korea 3.98 41.74 0.91 207.68 5.81
Luxembourg 10.35 21.80 3.73 2449.39 1.57
Malta 15.48 32.54 2.47 601.05 8.12
Norway 10.25 25.95 3.67 2231.03 3.62
Netherlands 14.65 24.71 3.25 1740.70 7.66
New Zealand 10.67 32.61 3.17 1487.52 1.76
Nicaragua 7.30 45.04 1.21 325.54 2.48
Panama 4.44 43.56 1.20 568.56 3.61
Paraguay 2.02 41.18 1.05 220.56 1.03
Peru 12.70 44.19 1.28 400.06 0.67
Portugal 12.49 28.96 2.85 579.51 7.48
South Africa 11.14 31.94 2.28 651.11 2.19
South Rhodesia 13.30 31.92 1.52 250.96 2.00
Spain 11.77 27.74 2.87 768.79 4.35
Switzerland 14.13 23.49 3.73 2630.96 2.70
Turkey 5.13 43.42 1.08 389.66 2.96
Tunisia 2.81 46.12 1.21 249.87 1.13
United Kingdom 7.81 23.27 4.46 1813.93 2.01
United States 7.56 29.81 3.43 4001.89 2.45
Venezuela 9.22 46.40 0.90 813.39 0.53
Zambia 18.56 45.25 0.56 138.33 5.14
Jamaica 7.72 41.12 1.73 380.47 10.23
Uruguay 9.24 28.13 2.72 766.54 1.88
Malaysia 4.71 47.20 0.66 242.69 5.08
> length(sr)
[1] 45
>
Part 2
Run regression analysis. R code is the following:
> lm(sr~pop15+pop75+dpi+ddpi)
Part 3
In this task we have developed a linear regression model. The data consists of 45 observations. Descriptive statistics is given below:
> summary(D)
sr pop15 pop75 dpi
Min. : 0.600 Min. :21.80 Min. :0.56 Min. : 88.94
1st Qu.: 7.560 1st Qu.:25.95 1st Qu.:1.08 1st Qu.: 289.71
Median :10.670 Median :31.94 Median :2.28 Median : 728.47
Mean : 9.956 Mean :34.83 Mean :2.27 Mean :1103.86
3rd Qu.:12.640 3rd Qu.:44.19 3rd Qu.:3.35 3rd Qu.:1740.70
Max. :21.100 Max. :47.64 Max. :4.70 Max. :4001.89
ddpi
Min. : 0.530
1st Qu.: 2.190
Median : 3.080
Mean : 3.663
3rd Qu.: 4.520
Max. :10.230
Scatterplots are given below:
The model has the following form:
Sr = b0+b1pop15+b2pop75+b3dpi+b4ddpi
We expect that the coefficient on pop15 is non-zero.
H0:β1=0
> summary(lm(sr~pop15+pop75+dpi+ddpi))
Call:
lm(formula = sr ~ pop15 + pop75 + dpi + ddpi)
Residuals:
Min 1Q Median 3Q Max
-7.9234 -2.4378 -0.4481 1.9852 9.8293
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 23.3400066 7.9453851 2.938 0.00547 **
pop15 -0.3763120 0.1533949 -2.453 0.01861 *
pop75 -1.1537013 1.1096724 -1.040 0.30473
dpi 0.0001556 0.0009241 0.168 0.86712
ddpi 0.5920887 0.2650672 2.234 0.03116 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.619 on 40 degrees of freedom
Multiple R-squared: 0.4017, Adjusted R-squared: 0.3419
F-statistic: 6.714 on 4 and 40 DF, p-value: 0.000312
ANOVA shows that the coefficients are jointly significant (F=6.714, p<0.001). However, not all coefficients are individually significant. For example, pop75 (p=0.30473) and dpi (p=0.86712) are not significant factors and may be excluded from the model. As for pop15, this factor is significant (p=0.01861) at 5% level of significance and the null hypothesis is rejected.
R-square shows that approximately 34.19% of variance in sr is explained by this model.