Professional Documents
Culture Documents
QUESTION #1
QUESTION 2
a. Confidence interval:
> .0598392-1.96*0.006
[1] 0.0480792
> lower_bound<-.0598392-1.96*0.006
> upper_bound<-.0598392+1.96*0.006
> print(c(lower_bound, upper_bound))
[0.0480792, 0.0715992]
The coefficient 0.059 lies within the 95% confidence interval, and
the previous section showed it to be significant at the 5% level,
meaning that education is statistically significant.
Call:
lm(formula = log(wage) ~ educ + exper, data = wage)
Residuals:
Min 1Q Median 3Q Max
-1.86915 -0.24001 0.03564 0.26132 1.30062
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.502710 0.112037 49.115 < 2e-16 ***
educ 0.077782 0.006577 11.827 < 2e-16 ***
exper 0.019777 0.003303 5.988 3.02e-09 ***
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
Call:
lm(formula = log(wage) ~ educ + exper + tenure, data = wage)
Residuals:
Min 1Q Median 3Q Max
-1.8282 -0.2401 0.0203 0.2569 1.3400
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.496696 0.110528 49.731 < 2e-16 ***
educ 0.074864 0.006512 11.495 < 2e-16 ***
exper 0.015328 0.003370 4.549 6.10e-06 ***
tenure 0.013375 0.002587 5.170 2.87e-07 ***
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
QUESTION #3
1. log(wage)=B0+B1educ+B2educ*pareduc+B3tenure+u
Holding all else constant and only changing educ:
log(wage)=B1educ+B2educ*pareduc
log(wage)=educ(B1+B2pareduc)
log(wage)/educ = B1+B2pareduc
2. Estimate model 4
a. > model4<-lm(log(wage)~educ+educ:pareduc+tenure, data=wage)
> summary(model4)
Call:
lm(formula = log(wage) ~ educ + educ:pareduc + tenure, data = wage)
Residuals:
Min 1Q Median 3Q Max
-1.90863 -0.24051 0.02678 0.26726 1.28671
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.0315779 0.1030887 58.509 < 2e-16 ***
educ 0.0325911 0.0102024 3.194 0.001462 **
tenure 0.0146925 0.0028870 5.089 4.6e-07 ***
educ:pareduc 0.0007413 0.0002138 3.467 0.000557 ***
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
Call:
lm(formula = log(wage) ~ educ + pareduc + educ:pareduc + tenure,
data = wage)
Residuals:
Min 1Q Median 3Q Max
-1.91704 -0.23329 0.02131 0.26594 1.29484
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.487671 0.368315 14.899 < 2e-16 ***
educ 0.071609 0.027338 2.619 0.009 **
pareduc 0.025999 0.016903 1.538 0.124
tenure 0.014891 0.002887 5.158 3.24e-07 ***
educ:pareduc -0.001094 0.001212 -0.902 0.367
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
t test of coefficients:
> library(car)
>linearHypothesis(model5,c("pareduc=0","educ:pareduc=0"),
vcov=vcovHC(model5, type="HC3"))
Linear hypothesis test
Hypothesis:
pareduc = 0
educ:pareduc = 0
Res.Df Df F Pr(>F)
1 719
2 717 2 7.532 0.0005791 ***
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
QUESTION #4
Call:
lm(formula = log(wage) ~ educ + exper + tenure + married + black +
south + urban, data = wage)
Residuals:
Min 1Q Median 3Q Max
-1.98069 -0.21996 0.00707 0.24288 1.22822
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.395497 0.113225 47.653 < 2e-16 ***
educ 0.065431 0.006250 10.468 < 2e-16 ***
exper 0.014043 0.003185 4.409 1.16e-05 ***
tenure 0.011747 0.002453 4.789 1.95e-06 ***
married 0.199417 0.039050 5.107 3.98e-07 ***
black -0.188350 0.037667 -5.000 6.84e-07 ***
south -0.090904 0.026249 -3.463 0.000558 ***
urban 0.183912 0.026958 6.822 1.62e-11 ***
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
t test of coefficients:
Call:
lm(formula = log(wage) ~ educ + exper + tenure + married + black +
south + urban + educ:black, data = wage)
Residuals:
Min 1Q Median 3Q Max
-1.97782 -0.21832 0.00475 0.24136 1.23226
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.374817 0.114703 46.859 < 2e-16 ***
educ 0.067115 0.006428 10.442 < 2e-16 ***
exper 0.013826 0.003191 4.333 1.63e-05 ***
tenure 0.011787 0.002453 4.805 1.80e-06 ***
married 0.198908 0.039047 5.094 4.25e-07 ***
black 0.094809 0.255399 0.371 0.710561
south -0.089450 0.026277 -3.404 0.000692 ***
urban 0.183852 0.026955 6.821 1.63e-11 ***
educ:black -0.022624 0.020183 -1.121 0.262603
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
t test of coefficients:
3. Test the null hypothesis that the effects of all dummy variables are equal to
zero with a heteroskedasticity F-test
a. > linearHypothesis(model6, c("exper=0", "tenure=0","married=0",
"black=0", "south=0", "urban=0"), vcov=vcovHC(model6, type =
"HC3"))
Linear hypothesis test
Hypothesis:
exper = 0
tenure = 0
married = 0
black = 0
south = 0
urban = 0
Res.Df Df F Pr(>F)
1 933
2 927 6 37.058 < 2.2e-16 ***
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
Because the p-value is smaller than the 0.05 alpha level and the f-
stat is higher than the 1.96 critical value, we reject the null
FINAL EXAM DANIKA LI
4. Extend the original model so that education depends on the amount of work
experience (model 8 with interaction term educ:exper). Obtain thetahat1
and a 95% confidence interval for theta1.
a. Holding all else equal:
log(wage)=B0+B1educ+B2exper+B3educ*exper+B4tenure+B5marrie
d+B6black+B7south+B8urban+u
log(wage)=B0+B1educ+B2exper+B3educ*exper+u
Plug in B1= 1-10B3
Log(wage)=B0+(1-10B3)educ+B2exper+B3educ*exper+u
=B0+1educ+B2exper-10B3educ+B3educ*exper+u
=B0+1educ+B2exper+B3educ(exper-10)+u
>model8<-lm(log(wage)~educ+exper+I(educ*(exper-10)),
data=wage)
> summary(model8)
Call:
lm(formula = log(wage) ~ educ + exper + I(educ * (exper - 10)),
data = wage)
Residuals:
Min 1Q Median 3Q Max
-1.88558 -0.24553 0.03558 0.26171 1.28836
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.949455 0.240826 24.704 <2e-16 ***
educ 0.076080 0.006615 11.501 <2e-16 ***
exper -0.021496 0.019978 -1.076 0.2822
I(educ * (exper - 10)) 0.003203 0.001529 2.095 0.0365 *
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
> lower_bound<-0.076080-1.96*0.006615
> upper_bound<-0.076080+1.96*0.006615
> print(c(lower_bound, upper_bound))
[1] 0.0631146 0.0890454
QUESTION #5
1. Estimate the model with only 1988 data. What are the estimated effect of
education and union membership? Are they significant at the 5% level?
a. > nls_panel<-read.csv("nls_panel.csv", header=TRUE)
> nls88<-subset(nls_panel, year==88)
>model88<-
lm(log(wage)~educ+exper+I(exper^2)+tenure+I(tenure^2)+black+s
outh+union, data=nls88)
> summary(model88)
Call:
lm(formula = log(wage) ~ educ + exper + I(exper^2) + tenure +
I(tenure^2) + black + south + union, data = nls88)
Residuals:
Min 1Q Median 3Q Max
-1.55873 -0.23842 -0.00052 0.23490 1.82679
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.2237350 0.2240258 0.999 0.318281
educ 0.0776627 0.0063978 12.139 < 2e-16 ***
exper 0.0787905 0.0307279 2.564 0.010549 *
I(exper^2) -0.0016709 0.0010510 -1.590 0.112327
tenure 0.0076095 0.0098219 0.775 0.438745
I(tenure^2) -0.0002872 0.0005024 -0.572 0.567701
black -0.1310958 0.0372783 -3.517 0.000465 ***
south -0.1370122 0.0336513 -4.072 5.2e-05 ***
union 0.1300245 0.0356196 3.650 0.000281 ***
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
t test of coefficients:
2. Estimate the model above with 1987 data. What are the estimated effects of
education and union membership? Are they similar to the results of 1988
data? Explain.
a. > nls87<-subset(nls_panel, year==87)
>model87<-
lm(log(wage)~educ+exper+I(exper^2)+tenure+I(tenure^2)+black+s
outh+union, data=nls87)
> summary(model87)
Call:
lm(formula = log(wage) ~ educ + exper + I(exper^2) + tenure +
I(tenure^2) + black + south + union, data = nls87)
Residuals:
Min 1Q Median 3Q Max
-1.52585 -0.25020 -0.01483 0.21843 2.61713
FINAL EXAM DANIKA LI
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.2242087 0.1890339 1.186 0.23599
educ 0.0759663 0.0062708 12.114 < 2e-16 ***
exper 0.0854817 0.0280038 3.053 0.00235 **
I(exper^2) -0.0020485 0.0010488 -1.953 0.05119 .
tenure 0.0068705 0.0097102 0.708 0.47945
I(tenure^2) -0.0001893 0.0005442 -0.348 0.72801
black -0.1574320 0.0366493 -4.296 1.99e-05 ***
south -0.1014177 0.0328986 -3.083 0.00213 **
union 0.1662697 0.0352498 4.717 2.89e-06 ***
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
t test of coefficients:
3. Using the original dataset, estimate the pooled OLS model. Whats the
estimated effect of being in a union? Using robust standard errors, did you
find any insignificant variables at the 5% significance level?
a. >pooledmodel<-
plm(log(wage)~educ+exper+I(exper^2)+tenure+I(tenure^2)+black+
south+union,data= nls.plm,model="pooling")
> summary(pooledmodel)
Pooling Model
Call:
plm(formula = log(wage) ~ educ + exper + I(exper^2) + tenure +
I(tenure^2) + black + south + union, data = nls.plm, model =
"pooling")
Residuals :
Min. 1st Qu. Median 3rd Qu. Max.
-1.70000 -0.23300 -0.00438 0.21500 2.58000
Coefficients :
Estimate Std. Error t-value Pr(>|t|)
(Intercept) 0.47660008 0.05615585 8.4871 < 2.2e-16 ***
educ 0.07144879 0.00268939 26.5669 < 2.2e-16 ***
exper 0.05568504 0.00860716 6.4696 1.116e-10 ***
I(exper^2) -0.00114754 0.00036129 -3.1762 0.0015046 **
tenure 0.01496002 0.00440728 3.3944 0.0006953 ***
I(tenure^2) -0.00048604 0.00025770 -1.8860 0.0593697 .
black -0.11671387 0.01571590 -7.4265 1.387e-13 ***
south -0.10600256 0.01420083 -7.4645 1.045e-13 ***
union 0.13224321 0.01496161 8.8388 < 2.2e-16 ***
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
t test of coefficients:
FINAL EXAM DANIKA LI
4. Estimate the individual fixed effects model. What is the sample size? Can you
find the coefficient on educ? Why was it dropped? Explain.
a. fixed_id<-
plm(log(wage)~educ+exper+I(exper^2)+tenure+I(tenure^2)+black+
south+union, data=nls.plm, model="within")
>coeftest(fixed_id,vcov=vcovHC(fixed_id,type="HC3",
cluster="group"))
t test of coefficients:
Sample size:
> pdim(fixed_id)
FINAL EXAM DANIKA LI
5. What is the estimated effect of union membership from the fixed_id model?
Compare it with the result from the pooled OLS model. Which model is
statistically reliable between the pooled OLS and fixed_id model?
a. Union membership in the fixed_id model is shown to yield a
6.37% increase in hourly wage. This is much smaller than the
estimated effect of union membership in the pooled OLS model
(13.22%).
The results of this pFtset show that the null hypothesis (no
significant fixed state effects) is rejected in favor of the
alternative hypothesis of significant fixed state effects.
Statistically, this test shows that you should use the fixed state
effects model.
During this examination, all work has been my own. I give my word that I have not
resorted to any ethically questionable means of improving my grade or anyone elses
on this examination and that I have not discussed this exam with anyone other than
my instructor.