#TASK 1 #Install package install.packages(‘wooldridge’)
library(wooldridge)
#Import data data(‘wage1’) force(wage1)
#TASK 2 AND 3 #Summaries and Descriptive summary(wage1[, c(“educ”, “exper”, “tenure”)])
#TASK 4 plot(wage1\(educ, wage1\)wage, main = “Wage VS Education”, xlab = “education in years”, ylab = “wage”, col = “#FFBF00”) plot(wage1\(exper, wage1\)wage, main = “Wage VS Experience”, xlab = “experience in years”, ylab = “wage”, col = “#669933”) plot(wage1\(tenure, wage1\)wage, main = “Wage VS Tenure”, xlab = “tenure in years”, ylab = “wage”, col = “#663333”)
cor(wage1[, c(“wage”, “educ”, “exper”, “tenure”)])
#TASK 5 model1 <- lm(wage ~ educ, data = wage1) summary(model1)
#TASK 6 model2 <- lm(wage ~ educ + exper, data = wage1) summary(model2)
model3 <- lm(wage ~ educ + tenure, data = wage1) summary(model3)
model4 <- lm(wage ~ educ + exper + tenure, data = wage1) summary(model4)
#Task 7 #In Model 2, the education coefficient is 0.64427, but after adding tenure in Model 4, #it decreases to 0.59897. This suggests that part of the effect previously attributed #to education was actually because of tenure. Since tenure significantly increases wages #and is likely correlated with education, omitting it caused an upward bias in the education #coefficient. The increase in R-squared from 0.2252 to 0.3064 further indicates that #including tenure improves the model and reduces omitted variable bias.
#TASK 8 #Install package install.packages(‘stargazer’) library(stargazer)
stargazer ( model1, model2, model3, model4, type= “text”, title= “Regression Runs”, dep.var.labels= “wage”, covariate.labels = c(“Education”, “Experience”, “Tenure”), digits = 3)
#TASK 9 #Across the these specifications, the coefficient on education changes as #additional variables are included. In Model1, education is 0.541, then #increases to 0.644 when experience is added in Model2, but declines to 0.569 #in Model3 and 0.599 in the full Model4. This changes suggests that the #estimated return to education is sensitive to the inclusion of other variables.
#The coefficient on experience is 0.070 in Model2 but falls sharply to 0.022 in Model4 #once tenure is included, and becomes only marginally significant. This suggests that #part of the effect previously attributed to general labor market experience was actually #because of tenure. Meanwhile, tenure remains consistently positive and statistically significant #(around 0.169–0.190) when included, showing a strong and stable impact on wages. #In conclusion, the changes in slope coefficients indicates that adding relevant controls #improves the model and gives more accurate estimates of each variable’s independent effect on wages.
#TASK 10 #(a.)Education: (o.569)= Each additional year of education increses hourly wage #by $o.569 holding other factors constant. Experience (0.070): Each additional year of experience #increases wage by $o.070. Tenure(0.190): Each additional year with the currentb employer increases wage by $o.190. #All coefficients are positive indicating that higher human capital increases wages.
#(B) All the independent variables less than 5% which means they are statistically significant.
#(C) All models have large and statistically significant F-statistics which means the independent #variables are jointly significant in explaining wage variation.
#Based on our lesson, the higher the r2 the better fit, because it measured how #well the model explained the variation of Y. This tells us that adding experience #and tenure improves the explanatory power of the model. The full model #explains about 30.2% of wage variation.
#TASK 11 #According to the results, there is a higghly significant in the relationship between education and #wage, experience to wage, and tenure and wage. Which means that these varaibles are relevant with each other. #If and only if, the government should be able to enhance how education system is being run effectively, it will #greatly improve the income of the country. That being said, economic growth will be experienced by the country. #This study is very helpful in addressing what to improve in the country. The regression results support human capital #theory, which suggests that education, work experience, and job tenure increase worker productivity and earnings. #Education consistently shows a positive and statistically significant effect on wages across all model specifications. #In the full model, each additional year of schooling increases wages by approximately $0.569 per hour, holding other factors #constant. Tenure has an even stronger marginal effect than general experience, suggesting that firm-specific human capital plays #an important role in wage determination.However, the R-squared value of 0.302 indicates that approximately 70% of wage variation #remains unexplained. This suggests that other factors such as ability, gender, occupation, industry, and regional differences may #also influence wages. The investigation could be improved by including additional control variables and possibly estimating a log-linear #model to interpret returns in percentage terms. Including more relevant variables would reduce omitted variable bias and improve the overall #explanatory power of the model.