Question
> pcmodel2 pcmodel3 screeplot(pcmodel2,type='lines',main='pcmodel2 plot') > screeplot(pcmodel3,type='lines',main='pcmodel3 plot') > jtrain2$factor jtrain3$factor model1 model2 model3 model4 model5 model6 model7 model8 model9 model10 model11 model12 model13 model14
> pcmodel2 <- prcomp(jtrain2[,.(re74,re75,age,educ,black,hisp)],scale=TRUE)
> pcmodel3 <- prcomp(jtrain3[,.(re74,re75,age,educ,black,hisp)],scale=TRUE)
> screeplot(pcmodel2,type='lines',main='pcmodel2 plot')
> screeplot(pcmodel3,type='lines',main='pcmodel3 plot')
> jtrain2$factor <- pcmodel2$x[,1]
> jtrain3$factor <- pcmodel3$x[,1]
> model1 <- lm(re78~train,data=jtrain2)
> model2 <- lm(re78~train,data=jtrain3)
> model3 <- lm(re78~train+re74+re75+age+educ+black+hisp,data=jtrain2)
> model4 <- lm(re78~train+re74+re75+age+educ+black+hisp,data=jtrain3)
> model5 <- lm(unem78~train+re74+re75+age+educ+black+hisp,data=jtrain2)
> model6 <- lm(unem78~train+re74+re75+age+educ+black+hisp,data=jtrain3)
> model7 <- glm(unem78~train+re74+re75+age+educ+black+hisp,family=binomial,data=jtrain2)
> model8 <- glm(unem78~train+re74+re75+age+educ+black+hisp,family=binomial,data=jtrain3)
> model9 <- glm(married~age+educ+black+hisp,family=binomial,data=jtrain2)
> model10 <- glm(married~age+educ+black+hisp,family=binomial,data=jtrain3)
> model11 <- glm(educ~age+black+hisp,family=poisson,data=jtrain2)
> model12 <- glm(educ~age+black+hisp,family=poisson,data=jtrain3)
> model13 <- glm(train~re74+re75+age+educ+black+hisp,family=binomial,data=jtrain2)
> model14 <- glm(train~re74+re75+age+educ+black+hisp,family=binomial,data=jtrain3)
> model15 <- lm(re78~train+re74+re75+age+educ+black+hisp,data=jtrain2[avgre<=10])
> model16 <- lm(re78~train+re74+re75+age+educ+black+hisp,data=jtrain3[avgre<=10])
> model17 <- lm(re78~train+factor,data=jtrain2[avgre<=10])
> model18 <- lm(re78~train+factor,data=jtrain3[avgre<=10])
> tidyw(model1)
# A tibble: 2 x 5
term estimate std.error statistic p.value
1 (Intercept) 4.55 0.341 13.4 9.42e-41
2 train 1.79 0.673 2.67 7.64e- 3
> tidyw(model2)
# A tibble: 2 x 5
term estimate std.error statistic p.value
1 (Intercept) 21.6 0.312 69.1 0.
2 train -15.2 0.658 -23.1 5.78e-118
> tidyw(model3)
# A tibble: 8 x 5
term estimate std.error statistic p.value
1 (Intercept) 0.674 2.39 0.282 0.778
2 train 1.68 0.664 2.53 0.0114
3 re74 0.0833 0.115 0.723 0.470
4 re75 0.0468 0.128 0.365 0.715
5 age 0.0543 0.0378 1.44 0.151
6 educ 0.404 0.160 2.53 0.0115
7 black -2.18 1.03 -2.11 0.0345
8 hisp 0.144 1.40 0.103 0.918
> tidyw(model4)
# A tibble: 8 x 5
term estimate std.error statistic p.value
1 (Intercept) 1.65 1.46 1.13 2.59e- 1
2 train 0.213 0.757 0.282 7.78e- 1
3 re74 0.281 0.0629 4.47 7.89e- 6
4 re75 0.569 0.0679 8.38 5.22e-17
5 age -0.0751 0.0206 -3.65 2.65e- 4
6 educ 0.520 0.0891 5.84 5.31e- 9
7 black -0.648 0.439 -1.47 1.41e- 1
8 hisp 2.20 1.24 1.77 7.59e- 2
> tidyw(model5)
# A tibble: 8 x 5
term estimate std.error statistic p.value
1 (Intercept) 0.226 0.160 1.41 0.158
2 train -0.114 0.0438 -2.60 0.00919
3 re74 -0.00266 0.00494 -0.539 0.590
4 re75 -0.00625 0.00740 -0.844 0.399
5 age 0.000247 0.00319 0.0773 0.938
6 educ -0.00119 0.0118 -0.101 0.919
7 black 0.184 0.0664 2.77 0.00559
8 hisp -0.0446 0.0820 -0.544 0.587
> tidyw(model6)
# A tibble: 8 x 5
term estimate std.error statistic p.value
1 (Intercept) -0.0447 0.0374 -1.19 2.32e- 1
2 train 0.0617 0.0347 1.78 7.54e- 2
3 re74 -0.00276 0.00106 -2.61 9.19e- 3
4 re75 -0.00764 0.00113 -6.74 1.55e-11
5 age 0.00751 0.000691 10.9 1.62e-27
6 educ 0.00921 0.00239 3.85 1.16e- 4
7 black -0.0493 0.0136 -3.63 2.82e- 4
8 hisp -0.0658 0.0288 -2.29 2.20e- 2
> tidyw(model7)
# A tibble: 8 x 5
term estimate std.error statistic p.value
1 (Intercept) -1.39 0.888 -1.56 0.118
2 train -0.560 0.223 -2.51 0.0119
3 re74 -0.0119 0.0280 -0.424 0.672
4 re75 -0.0407 0.0492 -0.826 0.409
5 age 0.00124 0.0154 0.0807 0.936
6 educ -0.00797 0.0586 -0.136 0.892
7 black 1.08 0.516 2.10 0.0361
8 hisp -0.271 0.701 -0.387 0.699
> tidyw(model8)
# A tibble: 8 x 5
term estimate std.error statistic p.value
1 (Intercept) -2.57 0.438 -5.87 4.27e- 9
2 train -0.0197 0.242 -0.0813 9.35e- 1
3 re74 -0.0308 0.0132 -2.34 1.93e- 2
4 re75 -0.124 0.0158 -7.87 3.68e-15
5 age 0.0562 0.00639 8.80 1.34e-18
6 educ 0.0573 0.0227 2.52 1.16e- 2
7 black -0.454 0.150 -3.02 2.51e- 3
8 hisp -0.998 0.352 -2.83 4.60e- 3
> tidyw(model9)
# A tibble: 5 x 5
term estimate std.error statistic p.value
1 (Intercept) -5.46 1.14 -4.80 0.00000157
2 age 0.0716 0.0158 4.53 0.00000603
3 educ 0.141 0.0738 1.91 0.0565
4 black 0.510 0.604 0.843 0.399
5 hisp 0.856 0.762 1.12 0.261
> tidyw(model10)
# A tibble: 5 x 5
term estimate std.error statistic p.value
1 (Intercept) -0.727 0.433 -1.68 9.30e- 2
2 age 0.0772 0.00810 9.53 1.65e-21
3 educ 0.0219 0.0244 0.900 3.68e- 1
4 black -1.15 0.128 -8.98 2.77e-19
5 hisp -0.123 0.351 -0.350 7.26e- 1
> tidyw(model11)
# A tibble: 4 x 5
term estimate std.error statistic p.value
1 (Intercept) 2.37 0.0489 48.4 0
2 age 0.000313 0.00169 0.185 0.853
3 black -0.0490 0.0285 -1.72 0.0858
4 hisp -0.137 0.0418 -3.29 0.00101
> tidyw(model12)
# A tibble: 4 x 5
term estimate std.error statistic p.value
1 (Intercept) 2.74 0.0162 169. 0.
2 age -0.00560 0.000486 -11.5 9.69e-31
3 black -0.221 0.0106 -20.8 7.10e-96
4 hisp -0.195 0.0341 -5.72 1.06e- 8
> tidyw(model13)
# A tibble: 7 x 5
term estimate std.error statistic p.value
1 (Intercept) -0.976 0.797 -1.22 0.221
2 re74 -0.0226 0.0252 -0.895 0.371
3 re75 0.0508 0.0427 1.19 0.233
4 age 0.0122 0.0139 0.875 0.382
5 educ 0.0651 0.0597 1.09 0.275
6 black -0.345 0.367 -0.939 0.348
7 hisp -0.918 0.519 -1.77 0.0770
> tidyw(model14)
# A tibble: 7 x 5
term estimate std.error statistic p.value
1 (Intercept) 2.59 0.942 2.75 5.96e- 3
2 re74 -0.148 0.0404 -3.67 2.44e- 4
3 re75 -0.271 0.0482 -5.63 1.84e- 8
4 age -0.116 0.0139 -8.36 6.26e-17
5 educ -0.0738 0.0455 -1.62 1.05e- 1
6 black 2.52 0.304 8.27 1.36e-16
7 hisp 2.21 0.528 4.19 2.84e- 5
> tidyw(model15)
# A tibble: 8 x 5
term estimate std.error statistic p.value
1 (Intercept) 1.74 2.29 0.757 0.449
2 train 1.58 0.675 2.35 0.0189
3 re74 -0.117 0.132 -0.882 0.378
4 re75 0.173 0.180 0.960 0.337
5 age 0.0440 0.0381 1.16 0.248
6 educ 0.358 0.149 2.40 0.0164
7 black -2.38 1.05 -2.26 0.0237
8 hisp -0.369 1.39 -0.266 0.790
> tidyw(model16)
# A tibble: 8 x 5
term estimate std.error statistic p.value
1 (Intercept) 3.45 1.90 1.82 6.92e- 2
2 train 1.84 0.875 2.11 3.49e- 2
3 re74 0.313 0.0886 3.53 4.11e- 4
4 re75 0.774 0.124 6.26 3.77e-10
5 age -0.0832 0.0259 -3.21 1.33e- 3
6 educ 0.328 0.120 2.73 6.31e- 3
7 black -1.97 0.652 -3.03 2.46e- 3
8 hisp -1.10 1.13 -0.978 3.28e- 1
> tidyw(model17)
# A tibble: 3 x 5
term estimate std.error statistic p.value
1 (Intercept) 4.44 0.343 12.9 3.01e-38
2 train 1.75 0.663 2.65 8.15e- 3
3 factor 0.396 0.217 1.82 6.87e- 2
> tidyw(model18)
# A tibble: 3 x 5
term estimate std.error statistic p.value
1 (Intercept) 13.1 0.972 13.5 1.57e-41
2 train 1.23 0.731 1.69 9.18e- 2
3 factor 3.68 0.543 6.78 1.21e-11
> margins(model7)
Average marginal effects
glm(formula = unem78 ~ train + re74 + re75 + age + educ + black + hisp, family = binomial,
data = jtrain2)
train re74 re75 age educ black hisp
-0.1136 -0.002404 -0.008248 0.0002514 -0.001615 0.2191 -0.05497
> margins(model8)
Average marginal effects
glm(formula = unem78 ~ train + re74 + re75 + age + educ + black + hisp, family = binomial,
data = jtrain3)
train re74 re75 age educ black hisp
-0.0016 -0.002508 -0.01008 0.004574 0.004661 -0.03695 -0.08119
> margins(model9)
Average marginal effects
Needs Grading
glm(formula = married ~ age + educ + black + hisp, family = binomial, data = jtrain2)
age educ black hisp
0.009477 0.01863 0.06744 0.1132
> margins(model10)
Average marginal effects
glm(formula = married ~ age + educ + black + hisp, family = binomial, data = jtrain3)
age educ black hisp
0.00979 0.002784 -0.1455 -0.01561
> margins(model13)
Average marginal effects
glm(formula = train ~ re74 + re75 + age + educ + black + hisp, family = binomial, data =
jtrain2)
re74 re75 age educ black hisp
-0.005381 0.01212 0.002904 0.01554 -0.08222 -0.2189
> margins(model14)
Average marginal effects
glm(formula = train ~ re74 + re75 + age + educ + black + hisp, family = binomial, data =
jtrain3)
re74 re75 age educ black hisp
-0.004253 -0.007781 -0.003336 -0.002117 0.07212 0.06337
Question
For this question, when I ask you to interpret also describe the statistical significance of the variable in question.
The data in the jtrain2 table comes from a job training experiment on men conducted during 1976-1977. jtrain3 also comes
from 1976-1977. re74, re75, and re78 denote the person's real earnings in 1974, 1975, and 1978. unem74, unem75, and
unem78 are indicator variables for unemployment in 1974, 1975, and 1978. train is an indicator variable showing whether or
not the man participated in job training (in either 1976 or 1977). black and hisp are dummies for race. age is a variable
indicating the man's age in years in 1977. educ is a variable indicating the man's years of education.
b. Interpret the estimated coefficients on the train variable in models 1 & 2.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started