How to estimate the bounds in R programming?

46 Views Asked by At

Consider the following model:

LnWage = b0 + b1yearsed + b2exper + b3exper2 + b4married + b5male + u.

Suppose the years of education variable are likely to be endogenous (because of omitted variables like ability or because of measurement error or because of interdependence between wages and education).

Assuming that measurement error exists, estimate the bounds in which the true effect of years of education lies for the simple 2 variable model:

LnWage = b0 + b1yearsed + e

# OLS estimate and standard error for the effect of education
Mod_1 <- coef(modell)["yearsed"] 
Mod_2 <- sqrt(vcov(modell)["yearsed", "yearsed"])

# Calculate the bounds
lower_bound <- Mod_1 - 1.96 * Mod_1
upper_bound <- Mod_1 + 1.96 * Mod_2

# Print the bounds
cat("The bounds for the true effect of years of education are: [", lower_bound, ", ", upper_bound, "]\n")

I used these commands and got an output. The bounds for the true effect of years of education are: [ -0.07193063 , 0.08573727]. But I feel like these codes would not be accepted in my assignment or the answer is wrong. Feels like I do not understand the question properly.

0

There are 0 best solutions below