Professional Documents
Culture Documents
RT1 Project 1&2 Assignment
RT1 Project 1&2 Assignment
RT1 Project 1&2 Assignment
# Project 1
library(skimr)
library(ggplot2)
library(dplyr)
library(broom)
library(stargazer)
library(wooldridge)
# 1 From the model we see that, only four factors are significant in affecting college GPA
#Yes, owning a computer will increase college GPA. This can be concluded from the
coefficient of PC which is significant at 5% level of significance. Owning a computer will
increase college GPA by .135 points
#4. Argue that including motherâs and fatherâs college level education have any bearing on
college gpa.
#Unrestricted Model
#Restricted Model
#And all of them continue to be significant while father college and mother college are
insignificant
#Therefore, adding these parameters does not have much change on collegeGPA
library(car)
linearHypothesis(model4, nullhyp)
#5. Add hsGPA2 to the model that you constructed in (1) and decide whether this generalization is
needed.
summary(model5)
#When hsGPA2 is added to the regression, its coefficient is about .334 and its t statistic is
#about 1.67. (The coefficient on hsGPA is about â1.78) This is a borderline case. The
###----------------------------------------------------------------------------------------------------------------------------
#### Project 2
# B6 south + B7 urban + u
# and report the results in tabular form. Holding other factors fixed, what is
summary(data2)
#and report the results in tabular form. Holding other factors fixed, what is the approximate
difference
#in monthly salary between blacks and non blacks? Is this difference statistically significant?
#The coefficient on black implies that, at given levels of the other explanatory variables, black
#men earn about 18.8% less than nonblack men. The t statistic is about â5, and so it is very
#statistically significant.
#2. Add the variables exper2 and tenure2 to the equation and show that they are jointly insignificant
at
summary(reg2)
linearHypothesis(reg2,nullhypo)
# with 2 and 925 df, is about 1.49 with p-value â .226. Because the p-value is above .20, these
quadratics are jointly
#3. Extend the original model to allow the return to education to depend on race and test whether
the
summary(reg2)
# The coefficient on the interaction is about â.0226. Therefore, this implies that is that the return to
# another year of education is about 2.3 percentage points lower for black men than nonblack men
#and the t-statistic is -1.12. on the basis of this we can reject the null hypothesis and say that
#4. Again, start with the original model, but now allow wages to differ across four groups of people:
married
#and black, married and nonblack, single and black, and single and nonblack. What is the estimated
#We do not add the fourth category unmarried black as adding all four will lead to multicollinearity
#Adding these to regression equation and removing the columns married and black to avoid
multicollinearity
summary(reg3)
# The coefficient of married black is +0.009, which means that married black
# The coefficient of married nonblack is +0.189, which means that married nonblack
#The differential between married blacks and married non blacks is given by
#the difference of their coefficients: .0094 â .189 = â.1796. That is, a
### married black man earns about 18% less than a, married nonblack man