# Big Assignment 4

### A number of organizations and governments are considering policies to supply students with access to free computers, in an effort to boost learning outcomes. Suppose that you want to learn about the effect of having a free computer on test scores. For a sample of high school students, you collect data on test scores (`test` ), parent’s income (`inc`), and whether they have a computer at home (`comp`).

### Part A:
#### Suppose that a local organization held a lottery, and offered computers at random to a number of students, indicated by freecomp. Suppose that among the population who were not offered a free computer, 60% have a computer, whereas after the lottery, 90% of people offered a computer had a computer. Compare the specifications

\begin{align}
test=\beta_0+\beta_1comp+u
\end{align}

#### or

\begin{align}
test=\beta_0+\beta_1freecomp+u
\end{align}


#### Both tell you something different about the effect of computers on test scores. Describe the limitations of each approach.

#### ANSWER:

 The first specification 
\begin{align}
test= \beta_0+\beta_1 comp+u
\end{align}
 describes the effect of having a computer on test scores, while the second specification
\begin{align}
test= \beta_0+\beta_1 freecomp+u
\end{align}

 describes the effect of being offered a computer on test scores. In other words, the first specification is explicitly about ownership of a computer, irrespective of whether or not one had one before the random distribution, while the second specification is interested in the individual having been offered a computer, irrespective of whether or not one had one before the random distribution, and with no conclusion yet as to whether the individual accepted the computer.

 Regarding limitations: In the first specification, one might be worried about unobservables that are correlated with having computer that are also correlated with test scores. For example, students who are more driven academically and try harder on tests may also be those who will pressure their parents to purchase them computers to work on. Meanwhile, in the second specification, we don’t learn what the effect of computers are on test scores. Instead, we learn about the effect of the program’s offer, which may not exactly be our interest.


### Part B: 
#### You are concerned that household income may be correlated with test scores for a variety of reasons. Suggest an alternate specification that holds income constant, and discuss how you anticipate it changing inference using each estimated $\beta_1$ above.

#### ANSWER:


Our specifications are now
\begin{align}
test= \beta_0+\beta_1 comp+\beta_2 income+u
\end{align}
and 
\begin{align}
test= \beta_0+\beta_1 freecomp+\beta_2 income+u
\end{align}

For specification 1, the exclusion of income from the specification previously was likely leading to omitted variable bias for beta 1, such that our estimate for beta 1 now suffers from less bias.

For specification 2, because freecomp is random, we know that E[u|T]=0 will be true in expectation but not always in samples, such that including more control variables can reduce bias. However, we usually don’t expect that adding a control will change the estimate of interest here. Including control variables will also increase the precision of estimates.


### Part C:
#### Propose a “Treatment on the treated” estimator for the free computer lottery.

#### ANSWER:

A treatment on the treated estimator for the effect of owning a computer can be written as follows:
\begin{align}
\frac{\overline{(test)_P}-\overline{(test)_{NP}}}{\overline{(comp)_P}-\overline{(comp)_{NP}} }
\end{align}
where P is assigned to group receiving and offer for a computer,NP is assigned to the group not receiving an offer for a computer, and comp is the proportion owning a computer.



### Part D: 
#### You think computers might have two different effects on test scores. On the one hand, they are a productive tool which can help learning. On the other hand, they open up recreational opportunities (like social networking) which may not be very useful for learning. As a result, you wonder what the effects of a free computer would be if you could hold recreational screentime constant. That is, you would like to estimate
\begin{align}
test=\beta_0+\beta_1freecomp+\beta_2screentime+u
\end{align}

#### However, in practice you cannot observe screentime. You have two options:  

#### - either you can just use whether they have a smart phone as a proxy variable for screentime (variable `Smartphone`), 

#### -or you can ask the students to report how much screentime they spend per day (`repscreentime`).
#### Describe algebraically how each approach will affect estimation of $\beta_1$ and $\beta_2$ in the equation for part D, and the analogue to MLR4 which is necessary to grant unbiased estimates. Discuss different potential forms for any measurement error, and the likely consequences of that measurement error.

#### ANSWER: 

We start out with our original model:
\begin{align}
test=\beta_0+\beta_1freecomp+\beta_2screentime+u
\end{align}
Case 1: Using `smartphone` represents the case described in Wooldridge 9.2 – Using Proxy Variables for Unobserved Explanatory Variables. `smartphone` is a proxy variable for `screentime`, which means we have

\begin{align}
screentime=\delta_0+\delta_2smartphone+\nu_2
\end{align}

where $\nu_2$ is an error due to the fact that `screentime` and `smartphone` are not related. If we plug in smartphone into the original model, then whether the proxy delivers consistent estimators depends on assumptions about $u$ and $\nu_2$.

(1) $u$ is uncorrelated with freecomp, screentime and smartphone, which are fairly standard assumptions implying that E$[u|freecomp, screentime, smartphone] = 0$.

(2)$\nu_2$ is uncorrelated with freecomp and smartphone. Assuming that $\nu_2$ is uncorrelated with freecomp requires smartphone to be a good proxy for screentime, which we can see by writing these assumptions in terms of conditional expectations
\begin{align}
E[screentime│freecomp,smartphone]=E[screentime│smartphone]\\
= \delta_0+\delta_2 smartphone
\end{align}

which is to say that once we control for smartphones, the expected value of screentime does not depend on freecomp. This may or may not be a reasonable assumption. But if we do assume this, then by plugging in we see that

\begin{align}
y=(\beta_0+\beta_2\delta_0 )+\beta_1 freecomp+ \beta_2 \delta_2 smartphone+u+\beta_2 \nu_2
\end{align}

the composite error can be written as $e = u + \beta_2 \nu_2$. Since both $u$ and $v_2$ have zero mean and each is uncorrelated with `freecomp` and `smartphone`, $e$ also has zero mean and is uncorrelated with `freecomp` and `smartphone`. We can write the above as 
\begin{align}
y=\alpha_0+\beta_1 freecomp+ \alpha_2 smartphone+e
\end{align}

Thus, when we run the regression of our y on freecomp and smartphone, we will not recover unbiased estimators of $\beta_0$ and $\beta_2$, but we will instead get unbiased estimators of $\alpha_0$, $\beta_1$, and $\alpha_2$.

If instead screentime was related to all observed variables by
\begin{align}
screentime= \delta_0+\delta_1 freecomp+\delta_2 smartphone+\nu_2
\end{align}

where $\nu_2$ has zero mean and is uncorrelated with `freecomp` and `smartphone`.  Substituting the above equation into the equation with y on the LHS, we have
\begin{align}
y=(\beta_0+\beta_2 \delta_0 )+(\beta_1+\beta_2 \delta_1)freecomp+ \beta_2 \delta_2 smartphone+u+\beta_2 \nu_2
\end{align}
such that the probability limit of estimated $\beta_1 = \beta_1 + \beta_2 \delta_1$, so we can still get an upward bias for `freecomp` if `smartphone` is not a good proxy.

Case 2: Using repscreentime represents the case described in Wooldridge 9.4b.We can have measurement error of 
\begin{align}
e_2=repscreentime-screentime
\end{align}
and we assume $E[e_2] = 0$. An important assumption is that u is uncorrelated with freecomp, repscreentime, and screentime. Usually $e_2$ is assumed to be uncorrelated with freecomp. However, the key issue is whether $e_2$ is uncorrelated with repscreentime. If it is uncorrelated, then the OLS regression of y on freecomp and repscreentime produces consistent estimators, which can be seen by writing
\begin{align}
y=\beta_0+\beta_1 freecomp+\beta_2 repscreentime+u-\beta_2 e_2
\end{align}

where $u$ and $e_2$ are both uncorrelated with all the explanatory variables. Under the CEV assumption that measurement error is uncorrelated with the unobserved explanatory variable, OLS will be biased and inconsistent, because $e_1$ is correlated with repscreentime, which means that all OLS estimators will be biased. There will also be attenuation bias on $\beta_2$.


### Part E:

#### Suppose instead that the organization offered free computers to the students whose parent’s income was in the bottom 20% of the school. Write down a regression equation which will implement a regression-discontinuity estimator to learn the impact of receiving a free computer. Discuss why results from that estimator may be different from the results from the randomized lottery in part A.


#### ANSWER:

To learn the impact of receiving a free computer, we can implement the following equation:
\begin{align}
test= \beta_0+\beta_1 bottom20_i+\beta_2 income_i+\beta_3 bottom20_i*income_i+u_i
\end{align}

where `bottom20` is an indicator variable for being a student whose parent’s income was in the bottom 20% of the school, and income is the income percentile that the individual’s parents fall into within the school. 

Results from this estimator may be different from the randomized lottery in part A for a number of reasons. For one, results may be different depending on the linearity between income and test scores, which would motivate us to limit our data to observations around the threshold.We are estimating the treatment effect on a different local population: in the RCT TOT estimator, we get a LATE on compliers, while in the RD we get a LATE on the people around the threshold. We might also be concerned about other policies that may have been enacted at or close to the threshold.Finally, we would be worried about possible gaming around the threshold, which would motivate us to see if there are more individuals reporting just under or at 20% compared to right above 20%. We will also want to know how well the cutoff was respected, while in the RCT presumably the protocols regarding offers being made or not made were well respected.




```R

```

ece68d3cef197a26d332677612aedf45dd990702
ipynb
Jupyter Notebook
Fall-19/ProblemSet4/Assignment_4_new_solutions.ipynb
sungsy12345/ENVECON-118
b2b62f49115f37e3a3c1f13b7ac6a3550c4c0600
BSD-3-Clause
2020-09-10T13:45:34.000Z
2021-11-01T21:41:59.000Z
Fall-19/ProblemSet4/Assignment_4_new_solutions.ipynb
sungsy12345/ENVECON-118
b2b62f49115f37e3a3c1f13b7ac6a3550c4c0600
BSD-3-Clause
2021-01-22T17:02:59.000Z
2021-06-20T14:03:54.000Z
Fall-19/ProblemSet4/Assignment_4_new_solutions.ipynb
sungsy12345/ENVECON-118
b2b62f49115f37e3a3c1f13b7ac6a3550c4c0600
BSD-3-Clause
2019-11-06T20:55:27.000Z
2021-06-20T08:14:41.000Z
Qwen/Qwen-72B
1. YES
2. YES