In: Statistics and Probability
1. Load the regression data in the le called wagedata.csv and
answer the following questions:
(a) Create an interaction between Ability and PhD
(b) Run a regression with the interaction a constant Ability and
PhD. Write down you estimators
and the t-statistics
(c) Compute the di erence-in-di erence estimate and write down you
answer.
(d) Test if the di erence is signi cant by showing relevant steps,
and write down the conclusion to
the test.
2. Which of these photos shows evidence of
heteroskedasticity?
0 20 40 60 80 100 120
0 100 200 300 400 500 600
x1
y1
−6 −4 −2 0 2 4 6
−10 0 10 20 30
x
y
−6 −4 −2 0 2 4 6
−10 −5 0 5 10
x
y
−6 −4 −2 0 2 4 6
−10 −5 0 5 10 15
x
y
3. Load the dataset called ec122a.csv and decide the appropriate
regression to run. Write down what
transformations, corrections, etc... you make and why.
Data
Wage;"Ability";"Phd" | |||
30 | 2148858244105;-10 | 0874543747999;1 | |
21 | 2139481124597;-0 | 590192820738451;1 | |
0 | 804274100356348;18 | 2611120427467;1 | |
21 | 2841837231414;-1 | 56022339054444;1 | |
19 | 9701441966751;-0 | 270217314022561;1 | |
-19 | 3505986647068;15 | 2847691646256;1 | |
-37 | 5318232168738;26 | 0961104031439;1 | |
-27 | 5104548523827;7 | 5761567533525;1 | |
1 | 12580739232134;-1 | 18594902993318;1 | |
8 | 46653345914067;0 | 0785472499891622;1 | |
-4 | 3851186614386;12 | 1320105514616;1 | |
3 | 50685341593623;7 | 34914917101494;1 | |
-13 | 9237294518445;18 | 4776393201793;1 | |
8 | 19952131952363;3 | 24253596299393;1 | |
2 | 061035907599;-0 | 483248819158479;1 | |
7 | 77793037392366;5 | 98655277801752;1 | |
-6 | 30291122168363;19 | 5012071181202;1 | |
9 | 8638921608847;17 | 2307860456577;1 | |
-1 | 60927411206267;0 | 627619361224518;1 | |
18 | 2636750628683;9 | 55865292554422;1 | |
-19 | 85280408247;32 | 3061680317419;1 | |
-38 | 3633350768018;27 | 9436433893924;1 | |
-40 | 7205010397063;31 | 6850695595438;1 | |
-56 | 2602894197782;35 | 0681431228772;1 | |
-32 | 9991761971437;27 | 6280924263471;1 | |
9 | 7479459402353;7 | 57174198307181;0 | |
3 | 92900982953838;0 | 861977409866384;0 | |
50 | 248108939599;33 | 5000136378381;0 | |
30 | 7461400746423;25 | 8930976678625;0 | |
49 | 9814106320709;46 | 0773964388559;0 | |
37 | 9566059786407;22 | 4655728587151;0 | |
68 | 6497575622049;49 | 1421665303397;0 | |
61 | 0701238471535;32 | 6494107219151;0 | |
55 | 7189943229771;34 | 2491817925178;0 | |
51 | 109332042575;48 | 4620545148998;0 | |
56 | 0861713803033;56 | 2611865964331;0 | |
40 | 516170174837;29 | 6930159318191;0 | |
44 | 0586166449751;35 | 2492085855466;0 | |
59 | 6616305513546;45 | 3875176058839;0 | |
30 | 4331767384442;38 | 1275770320187;0 | |
54 | 8625391374503;41 | 2616692882961;0 | |
23 | 5581065455008;42 | 2396991920984;0 | |
51 | 6104307198847;49 | 4530276941521;0 | |
68 | 8499222925911;57 | 375001650011;0 | |
34 | 9282337106992;33 | 7966475747671;0 | |
59 | 6531629794339;32 | 9891986645948;0 | |
48 | 8530160146515;42 | 5814753560819;0 | |
41 | 8592579309319;38 | 2969055544136;0 | |
68 | 7653893378851;59 | 1407240737376;0 | |
57 | 2611898080186;55 | 2997953033722;0 | |
71 | 4317975269271;59 | 8575740860399;0 | |
84 | 3041078190792;56 | 9187686247403;0 | |
86 | 8127563905414;57 | 8447954875125;0 | |
53 | 8947609338275;42 | 9180372026626;0 | |
75 | 451187082937;66 | 4714537888208;0 | |
71 | 8524802636783;66 | 5647387578261;0 | |
72 | 7015631893814;63 | 9321052241629;0 | |
68 | 5345645066989;46 | 9435171993065;0 | |
57 | 4027012602536;40 | 8696600009591;0 | |
94 | 3208057977659;70 | 4812637532467;0 | |
73 | 3865424233984;56 | 9041537923933;0 | |
88 | 8183392221799;70 | 0278010012836;0 | |
73 | 3087112512961;56 | 9953148483697;0 | |
86 | 3886013131513;60 | 5180523355662;0 | |
67 | 2021941169906;51 | 0590708916793;0 | |
118 | 375388309556;94 | 4572602759228;0 | |
60 | 6789396907979;61 | 1500381246522;0 | |
98 | 719626489431;77 | 9170774341119;0 | |
71 | 443350318515;66 | 314958140777;0 | |
64 | 6034850016771;58 | 4809681916044;0 | |
73 | 1618976038289;65 | 1237350851343;0 | |
60 | 4746000022732;63 | 0423330904353;0 | |
120 | 289733522426;93 | 5416148319245;0 | |
107 | 032173927375;79 | 1334457282595;0 | |
91 | 8986502218894;74 | 6191805319747;0 | |
80 | 7706797354782;69 | 0717782611234;0 | |
94 | 9972106243549;76 | 4438198039696;0 | |
69 | 4704718368837;66 | 2502018108482;0 | |
100 | 848924827906;80 | 8871627341593;0 | |
126 | 836422964446;84 | 3088129083253;0 | |
123 | 570430325546;96 | 9617142388936;0 | |
64 | 9631783153722;69 | 8731666565007;0 | |
94 | 8537176555163;83 | 4972763448062;0 | |
130 | 547827259813;91 | 5406501517776;0 | |
93 | 4716274384042;79 | 6440870678146;0 | |
103 | 69870631698;79 | 8560598931133;0 | |
90 | 4185801410255;76 | 4545817393735;0 | |
87 | 0684258802465;84 | 5415174865785;0 | |
145 | 840161057534;111 | 032359346546;0 | |
123 | 719439438811;98 | 0032391174047;0 | |
117 | 321770358635;90 | 845864156288;0 | |
124 | 037150698884;105 | 148580858475;0 | |
114 | 982603027777;94 | 3143209557192;0 | |
139 | 514587413482;113 | 254090704761;0 | |
109 | 802729838307;91 | 8569567410886;0 | |
111 | 534270833463;94 | 1269472639582;0 | |
99 | 5545891547564;78 | 9229661614192;0 | |
95 | 841141946642;85 | 3461049648653;0 | |
113 | 258297584026;96 | 8252063828309;0 | |
124 | 340999773273;99 | 8886185674963;0 |
Answer:
BY using,given data
(a) By using the scatter plot we can identify the relation between the Ability and Phd.
From the above plot, we can say that if the ability of students increases then the chances of he pursued PhD is decreased.
i.e. Negative correlation in ability and PhD.
(B) The Dependent variable in this data is PhD and
Independent variable in wages and Ability
Dependent variable PhD is not continuous it in categorical form
so ,we used the logistic regression model here,
Model = glm(Phd~Ability+Wage)
Summary.glm(Model)
glm(formula = Phd ~ Ability + Wage)
Coefficients: Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.799626 0.048791 16.389 < 2e-16 ***
Ability 0.004379 0.002086 2.099 0.0384 *
Wage -0.011972 0.001347 - 8.886 3.41e-14 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
The coefficient of wage = - 0.011972
The Coefficient of Ability = 0.004379
Test Hypothesis:
H0: The variable is insignificant.
against,
H1: The variable is significant.
Test Statistic:
T-statistic is usefull
t-value of Ability = 2.099
t-value of wage = -8.886
Decision Rule: If p-value is greater than 0.05 level of
significance then ,we accept the null hypothesis.
From the above results, p-values are less than 0.05.
we reject the null hypothesis here.
i.e. both are variable significant.
i.e. both variable wage and Ability are important in model.