Q1
Given variables:U: Unobserved confounder (individual’s ability); Z: Instrumental variable (whether an individual was offered the scholarship); D: Treatment variable (whether an individual went through the job training program); Y: Outcome variable (wages). In DAG: U affects both D and Y. Z affects D, as individuals who were offered the scholarship were more likely to enroll in the job training program. D affects Y, as the job training program is expected to influence wages. There is no direct edge between Z and Y, as the scholarship offer only affects wages through its influence on the treatment variable D.
Based on DAG, the exogenous variation in Z can be used as an instrumental variable to determine the causal effect of the job training program (D) on wages (Y). The random assignment of the scholarship offer (Z) provides exogenous variation that is independent of the unobserved confounder U and affects the treatment variable D but not the outcome variable Y directly. By leveraging this exogenous variation in Z as an instrumental variable, the endogeneity issue caused by the unobserved confounder U can be addressed, allowing for the consistent estimation of the causal effect of the job training program on wages.
It seems to be likely met: Relevance assumption: Since the scholarship offer (Z) influences whether individuals enroll in the job training program (D), it is reasonable to expect a correlation between Z and D, satisfying the relevance assumption. Exclusion restriction: The scholarship offer (Z) itself should not directly affect wages (Y), except through its impact on the job training program participation (D).
In the first stage, the treatment variable (D) is regressed on the instrumental variable (Z) and other exogenous covariates. In the second stage, the outcome variable (Y) is regressed on the fitted values of the treatment variable from the first stage and other exogenous covariates. The coefficient of the fitted treatment variable in the second stage regression provides the consistent estimate of the causal effect, βIV. Alternatively, 2SLS can be implemented in a single step by using the instrumental variable (Z) and other exogenous covariates as instruments for the treatment variable (D) in a single regression of the outcome variable (Y) on the treatment variable and other exogenous covariates.
The estimated effect obtained through an instrumental variable (IV) approach is considered “local” because it captures the causal effect of the treatment only for a specific subgroup called “compliers,” who are individuals whose treatment status is influenced by the instrument. The IV estimate, known as the Local Average Treatment Effect (LATE), does not provide an estimate of the causal effect for the entire population, as it excludes individuals who would always take the treatment regardless of the instrument (always-takers), those who would never take the treatment regardless of the instrument (never-takers), and those who exhibit a perverse response to the instrument (defiers).
Q2
set.seed(123)
n <- 10000
Z <- rnorm(n, 0, 1)
U <- rnorm(n, 10, sqrt(10))
X <- rnorm(n, 0, 1) + 3 * Z + U
e <- rnorm(n, 0, 1)
Y <- 2 * X + U + e
# OLS regression of Y on X (without controlling for U)
ols_model <- lm(Y ~ X)
summary(ols_model)
##
## Call:
## lm(formula = Y ~ X)
##
## Residuals:
## Min 1Q Median 3Q Max
## -9.1778 -1.6777 -0.0166 1.6380 9.0787
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.049959 0.059796 84.45 <2e-16 ***
## X 2.493723 0.005473 455.63 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.461 on 9998 degrees of freedom
## Multiple R-squared: 0.9541, Adjusted R-squared: 0.954
## F-statistic: 2.076e+05 on 1 and 9998 DF, p-value: < 2.2e-16
# Method 1 for 2SLS
first_stage <- lm(X ~ Z)
X_hat <- fitted(first_stage)
second_stage <- lm(Y ~ X_hat)
summary(second_stage)
##
## Call:
## lm(formula = Y ~ X_hat)
##
## Residuals:
## Min 1Q Median 3Q Max
## -35.955 -6.543 -0.094 6.520 35.745
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.96264 0.33425 29.81 <2e-16 ***
## X_hat 2.00033 0.03211 62.30 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 9.745 on 9998 degrees of freedom
## Multiple R-squared: 0.2796, Adjusted R-squared: 0.2795
## F-statistic: 3881 on 1 and 9998 DF, p-value: < 2.2e-16
# Method 2 for 2SLS
one_step_2sls <- lm(Y ~ X, instrument = ~Z)
## Warning: In lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
## extra argument 'instrument' will be disregarded
summary(one_step_2sls)
##
## Call:
## lm(formula = Y ~ X, instrument = ~Z)
##
## Residuals:
## Min 1Q Median 3Q Max
## -9.1778 -1.6777 -0.0166 1.6380 9.0787
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.049959 0.059796 84.45 <2e-16 ***
## X 2.493723 0.005473 455.63 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.461 on 9998 degrees of freedom
## Multiple R-squared: 0.9541, Adjusted R-squared: 0.954
## F-statistic: 2.076e+05 on 1 and 9998 DF, p-value: < 2.2e-16
# Method 3: Using the AER package
aer_2sls <- ivreg(Y ~ X | Z)
summary(aer_2sls)
##
## Call:
## ivreg(formula = Y ~ X | Z)
##
## Residuals:
## Min 1Q Median 3Q Max
## -11.75239 -2.23287 -0.04497 2.19912 11.86874
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.96264 0.11366 87.66 <2e-16 ***
## X 2.00033 0.01092 183.20 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.314 on 9998 degrees of freedom
## Multiple R-Squared: 0.9167, Adjusted R-squared: 0.9167
## Wald test: 3.356e+04 on 1 and 9998 DF, p-value: < 2.2e-16
Q3.Chapter 15 of Wooldridge, Problem 1.
Family income for example could be counted in the error terms that affect GPA and is also likely to be correlated with PC ownership.
Families that has higher incomes could buy computers for their children, since it’s correlated with the endogeneous explanatory variable, faminc satisfies the second requirement for IV, but faminc also could have a positive affect on GPA, so the fails to be a good IV according to the first requirement.
Some students could buy computers when they are given the grant and could not when they don’t have. Some who didn’t receive might still own computers. We define grant as one dummy variable, 1 when the student receive a grant and 0 otherwise. If grant is randomly asssigned, it’s not correlated with u but correlated with PC that PC ownership for those who receive grants could be higher.
Q5.Chapter 15 of Wooldridge, Problem 10.
About u and CathHS:Students who tend to go to college may in a sense be attracted to Catholic high schools. And students could be self-selecting Catholic high schools rather than randomly assigned.
The standardized test score measures students’ ability and can be used as a proxy variable in OLS regression.Which could be better.
The first requirement that CathRel should be uncorrelated with unobserved student motivationa and ability and other factors in error term. This may holds if growing as a Catholic would not naturally make one a better student compared to those just attending a Catholic high school. The second is that being Catholic has effect on attending a Catholic high school controlling other factors, which can be tested by CathHS=π0 + π1CathRel + (other exogenous factors) + (reduced form error).
Being Catholic substantially increases the probability of attending a Catholic high school and it seems reasonable assuming CathRel is exogenous in the structural equation.