09: Endogeneity

Endogeneity

Transcript

This slide gives you the definition that ties the rest of the lecture together. Look at the first expression. It says that the expected value of the error, called u, conditional on values of all k explanatory variables, x one through x k, is not zero. “Conditional on” means that we compare observations with the same included x values. In a correctly specified causal OLS model, once those x values are fixed, the remaining unobserved determinants in u should not be systematically positive or negative. Endogeneity is the failure of that zero-conditional-mean requirement.

The red phrase “for whatever reason” is important. We call a particular explanatory variable endogenous whenever it is correlated with the error term. The definition does not depend on how that correlation arose. Once x k and u move together, OLS cannot hold the unobserved component fixed while changing x k. Its coefficient mixes the effect of x k with the effects of factors hidden in u, so the usual causal interpretation is not justified. The issue is systematic correlation, not simply that the error is large or that an observation is unusual.

At the bottom you see the four mechanisms we will study, and the sentence above them is the thread that ties them together. However endogeneity comes about, it is omitted variable bias. Saying that x k is correlated with u is the same as saying that u contains some component that is correlated with x k. That component is the omitted variable; if you could observe it and add it to the regression, the bias would disappear. The four mechanisms differ only in what that component is and how it got into the error.

With an omitted variable, it is a variable that affects the outcome, is left out, and is related to an included regressor. With selection, it is the set of factors that people, firms, doctors, or governments use to choose the treatment and that also affect the outcome. With reverse causality, and its close relative simultaneity, it is the shock to the outcome itself, which moves the explanatory variable through the outcome. With measurement error, it is the recording error, which sits inside the observed regressor and also in the error term. The last slide of this lecture comes back to this list and checks it with one formula.

Endogeneity

E[u\mid x_1,\dots,x_k] \ne 0

The zero-conditional-mean assumption fails: the error term is systematically related to at least one explanatory variable.


Endogenous independent variable

If an explanatory variable x_k is, for whatever reason, correlated with the error term, we call x_k an endogenous explanatory variable.


Sources of endogeneity

However it comes about, endogeneity is omitted variable bias: some component of the error term is correlated with x_k. The sources differ in what that component is.

  • Omitted variable: a variable that affects y is left out
  • Selection: the factors behind the choice of x_k also affect y
  • Reverse causality (and simultaneity): shocks to y move x_k
  • Measurement error: the recording error in x_k ends up in the error term

Omitted Variable

Transcript

Use these two equations to see exactly how an omitted variable creates endogeneity. The top line is the true population model. The outcome is log wage, so beta one is the change in log wage associated with one more unit of education, holding experience and ability fixed. Beta zero is the intercept. Beta two is the partial effect of experience, beta three is the partial effect of ability, and u contains the remaining determinants of log wages. For OLS to recover these causal coefficients, u must have conditional mean zero given education, experience, and ability.

Now look at the model we can actually estimate if ability is unavailable. It includes education and experience but omits ability. Omitting it does not make its wage contribution disappear. On the right of the second line, the new composite error v equals the original u plus beta three times ability. That algebra is why an omitted determinant belongs in the new error term.

The education regressor is endogenous in this shorter equation if education is related to ability. In that case, education is correlated with a component of v. OLS cannot compare people who differ in education while holding ability fixed, because ability is unobserved and tends to change with education. The estimated coefficient on education then combines the return to education with some of ability’s association with wages.

True Model

\log(wage) = \beta_0 + \beta_1 educ + \beta_2 exper + \beta_3 ability + u


Incorrectly specified (your) model

\log(wage) = \beta_0 + \beta_1 educ + \beta_2 exper + v, \qquad v=u+\beta_3 ability

Transcript

Now build an example of your own, ideally from a question you might actually work on in a paper or thesis. The wage example on the previous tab is the template; your job is to replace each piece of it with something from your field.

Step one asks for two variables: an outcome y and an explanatory variable x whose effect on y you want to know. State the effect in words, for example “how much does one more unit of x change y.”

Step two is the omitted variable itself. It has to satisfy two conditions at once, and the exercise asks for both. It must affect y; a variable that has no effect on the outcome does not belong in the error term in the first place. And you must be unable to observe it in your data, or able to observe it only so crudely that including it would not capture it. Ability in the wage example meets both conditions: it raises wages, and no ordinary dataset records it.

Step three is the one that makes it endogeneity. Explain why the omitted variable is correlated with x. A variable can affect y and be missing from the data without causing any bias, if it is unrelated to x. Give a reason for the correlation, not just an assertion: who chooses x, and why would that choice be related to the omitted variable?

Step four asks you to write the two equations the way the slide does: the true model with the omitted variable in it, and the model you can estimate, with the omitted variable moved into the composite error. Then use the two signs, the effect of the omitted variable on y and its correlation with x, to say whether you expect OLS to overstate or understate the effect of x.

Exercise

Come up with your own example of an omitted variable that makes an explanatory variable endogenous.

  1. Pick an outcome y and an explanatory variable x whose effect on y you want to know.
  2. Name a variable that affects y but that you cannot observe in your data.
  3. Explain why that variable is correlated with x.
  4. Write the true model and the model you can estimate, as on the previous tab, and say whether you expect OLS to overstate or understate the effect of x.

Bias from self-selection

Transcript

This example turns the definition of endogeneity into a research-design question. We want to know whether a soil-moisture sensor reduces a farmer’s irrigation. The data are observational, not experimental, so no researcher randomly assigns sensors. Each farmer decides whether to adopt one. That distinction matters because adopters and non-adopters may differ before the sensor has any effect.

Look at the model of interest. Irrigation is the amount of water applied by the farmer. Beta zero is the expected irrigation amount for the reference group, farmers with sensor equal to zero, subject to the interpretation of the error. Sensor is an indicator: it equals one for an adopter and zero for a non-adopter. Beta one is therefore the difference in expected irrigation associated with adoption. If lower irrigation means water savings, a beneficial sensor effect would make beta one negative. The error u collects every other determinant of irrigation omitted from this very simple equation, such as soil, crop choice, weather, water prices, farm management, and conservation preferences.

For beta one to be a causal sensor effect, sensor status must be unrelated to those unobserved determinants. That is the question in red at the bottom: is sensor correlated with u? A raw regression can calculate an association even when the answer is yes, but the association then mixes the technology’s effect with pre-existing differences between adopters and non-adopters.

Research Question

Does a soil moisture sensor reduce water use for farmers?


Data

Observational (non-experimental) data on soil moisture sensor adoption and irrigation amount


Model of interest

irrigation = \beta_0 + \beta_1 sensor + u

  • irrigation: the amount of irrigation by the farmer
  • sensor: indicator equal to 1 if the farmer adopted a soil-moisture sensor


Question

Is sensor endogenous (is sensor correlated with the error term)?

Transcript

Treat adoption as an outcome of a separate decision, not as if it were assigned by a coin flip. The displayed selection equation says sensor equals alpha zero plus alpha one times x one, continuing through alpha k times x k, plus v. Alpha zero is a baseline adoption propensity. The x variables represent factors farmers use when deciding whether a sensor is worthwhile, and each alpha describes how one of those factors changes adoption. Because sensor is actually a zero-one variable, this linear equation is a stylized way to organize the determinants of adoption, not a claim that the decision is literally continuous. The disturbance v contains additional influences on adoption that are not listed.

For the first question, plausible x variables include soil type, field size, crop mix, irrigation technology, water price, prior drought experience, access to credit, technical ability, and conservation preferences. Farmers can rationally use all of this information. The econometric problem appears when you answer the second question. Many of the same variables also determine irrigation demand. Sandy soil may increase both the value of timely moisture information and the amount of water a field needs. High water prices may encourage sensor adoption while independently reducing water use. Conservation-minded farmers may adopt and may also irrigate less even without a sensor.

Those shared causes make adopters and non-adopters systematically different before treatment.

Farmers do not adopt soil-moisture sensors randomly. They use available information to decide whether adoption would benefit them.


Adoption (selection) equation

sensor = \alpha_0 + \alpha_1 x_1 + \dots + \alpha_k x_k + v


Question

What variables might farmers consider when deciding whether to adopt a soil-moisture sensor?


Question

Do any of the variables listed above also affect irrigation demand?

Transcript

This tab isolates soil quality or soil type as one concrete common factor. The first bullet says farmers with sandy fields may be more likely to adopt a soil-moisture sensor. Sandy soil drains quickly, so knowing current moisture can be especially useful for timing irrigation. The second bullet says sandy fields may also require more irrigation because they retain less water. Soil type therefore belongs in both behavioral stories: it helps determine the adoption decision and it directly affects the irrigation outcome.

Now follow the two paths summarized under “Key.” Sensor is a function of soil type, meaning the distribution of sensor status changes across soil types. Irrigation is also a function of soil type. If we do not accurately control for soil type in the irrigation regression, its effect is absorbed by the error term. Sensor status is then correlated with a factor inside that error, which is precisely endogeneity.

Example

Soil quality/type (hard to accurately measure)

  • Farmers whose fields are sandy may be more likely to adopt a soil-moisture sensor.
  • Sandy fields may require more irrigation.


Key

Soil quality or type affects both sensor adoption and irrigation.

  • sensor is a function of soil quality/type
  • irrigation is also a function of soil quality/type, which enters the error term when it is not controlled for
Transcript

Here is the common-factor argument written directly in the outcome equation. Read the line as irrigation equals beta zero, plus beta one times sensor, plus a parenthetical composite error. Beta one is the causal sensor effect we want. Inside the parentheses, beta sub s is the effect of soil type on irrigation, “soil type” is the omitted common factor, and v contains all other unobserved determinants of irrigation. The entire parenthetical expression is the error term in a regression that includes sensor but leaves soil type out.

Now connect this equation to the previous tab. Sensor adoption varies with soil type. Soil type also appears inside the composite error through beta sub s times soil type. Therefore sensor and the regression error vary together. OLS cannot separate irrigation changed by the sensor from irrigation associated with the different soils on which sensors are disproportionately adopted.

The callout’s conclusion is bias in the estimated impact of a sensor. The decisive point is that adopters differ from non-adopters along a factor that also affects irrigation.

\begin{aligned} irrigation = \beta_0 + \beta_1 sensor + (\beta_s\,\text{soil type}+v) \end{aligned} where v includes all other unobserved determinants of irrigation.

Note

So, sensor and the error term in the irrigation model are correlated through soil type, leading to biased estimation of the impact of a sensor.

Transcript

The callout states the main lesson from this example: selection bias is a form of omitted-variable bias when the factors driving selection also affect the outcome and are excluded from the outcome equation. That observation suggests a possible remedy. If you can accurately measure the common factors, include them explicitly rather than leaving them in the error.

Look at the revised equation. Irrigation equals beta zero, plus beta one times sensor, plus beta sub s times soil type, plus v. Once soil type is included, beta one compares adopters and non-adopters at the same included value of soil type. Beta sub s captures systematic irrigation differences associated with soil, and v now contains the other unobserved determinants. Soil’s contribution is no longer automatically part of the error, so this particular path from sensor to the error is closed.

The qualifications beneath the equation do real work. Soil type must be measured accurately. A crude category may leave relevant soil variation in v, while measurement error in the control may fail to remove the confounding completely. Most importantly, there must be no other common causes of adoption and irrigation left in v. Controlling for soil does not solve confounding from crop choice, management skill, conservation preferences, or water price if those still link sensor to the error.

Note

Selection bias is a form of omitted variable bias.


If you accurately measure the common factors in the two equations, you can simply include them explicitly in the main model.

For example,

\begin{aligned} irrigation = \beta_0 + \beta_1 sensor + \beta_s\,\text{soil type} + v \end{aligned}

If soil type is measured accurately and there are no other confounders, including it removes this source of correlation between sensor adoption and the error term.

Transcript

Your turn to find a selection problem. Use the soil-moisture sensor as the template, and follow the same order of questions the tabs used.

Step one asks for a treatment that is chosen rather than assigned. It can be a technology a farm adopts, a program a person enrols in, a practice a firm takes up, or a policy a government chooses. The key word is “choose”: somebody decides whether to receive the treatment, and that somebody knows things about themselves that you, the researcher, may not.

Step two is the outcome equation, written the way the Context tab wrote irrigation equals beta zero plus beta one sensor plus u. Say what beta one measures in your example.

Step three is the selection equation, the counterpart of the Adoption decision tab. List the factors the decision-maker plausibly weighs when choosing. Be concrete, as the slide was with soil type, field size, water price and conservation preferences.

Step four is where the endogeneity appears. Go through your list and ask which factors also affect the outcome directly, not only through the treatment. Pick one, and trace the two paths the Common factors tab traced for soil type: it changes who takes the treatment, and it changes the outcome. That pair of paths is what makes the treatment correlated with u.

Step five connects to the last tab, where selection bias turned out to be a form of omitted variable bias. If you could measure that common factor accurately and include it, this particular path would be closed. Ask honestly whether you could. If the factor is something like motivation, skill or preferences, the answer is usually no.

Exercise

Come up with your own example of bias from self-selection.

  1. Think of a treatment, program, practice or technology that people (or farms, firms, governments) choose for themselves.
  2. Write the outcome equation: outcome = \beta_0 + \beta_1 treatment + u.
  3. List the factors that drive the choice (the selection equation).
  4. Which of those factors also affect the outcome directly? Explain how one of them makes treatment correlated with u.
  5. Could you measure that factor accurately and control for it? Why or why not?

Reverse Causality

Transcript

Now apply the same diagnostic habit to medical treatment. The research question is causal: does this treatment improve health? But the red word “cross-sectional” tells you what the data can directly compare. We observe different patients’ current treatment status and current health at one point in time. We do not observe a before-and-after change for each patient, and doctors, rather than a randomized experiment, choose who receives treatment.

In the displayed model, health is the patient’s current health measure. Treatment is an indicator equal to one for a treated patient and zero for an untreated patient. Beta zero describes expected health for the untreated reference group under the model, and beta one is the treated-versus-untreated difference we would like to interpret as the treatment’s effect. The error u contains all other determinants of current health not included in this simple equation, such as underlying severity, prognosis, age, behavior, access to care, and other medical conditions.

The endogeneity question at the bottom asks whether treatment status is correlated with those omitted health determinants. That is highly plausible because doctors use health information when prescribing treatment.

Cross-sectional OLS gives an association between currently treated and untreated people. It does not reconstruct what the same treated patients’ health would have been without treatment.

Research Question

Does a particular type of medical treatment improve health?


Data

Observational (non-experimental) cross-sectional data on a particular type of medical treatment and current health. Treatment is chosen by doctors rather than randomly assigned.


Model

health = \beta_0 + \beta_1 treatment + u

  • health: measure of a patient’s current health
  • treatment: indicator equal to 1 if the patient receives treatment

This model compares the health of treated and untreated patients at a point in time; it does not make a before-and-after comparison.


Question

Is treatment endogenous? (Is treatment correlated with the error term?)

Transcript

The first question asks how doctors decide whether to place patients under treatment. Open the answer and you see the essential input: their patients’ health conditions. In practice doctors may use symptoms, test results, medical history, expected prognosis, contraindications, and many other variables, but the key point is that assignment responds to information about health. Treatment is therefore selected, not randomly assigned.

The stylized selection equation says treatment equals alpha zero plus alpha one times health plus v. Alpha zero is a baseline treatment propensity, alpha one describes how the health measure changes the probability or level of treatment, and v contains other determinants of the doctor’s decision. Since treatment is a zero-one indicator, think of this equation as a compact representation of selection. The sign of alpha one depends on how health is coded. If larger health values mean better health and less healthy people are more likely to be treated, alpha one is negative.

Treatment status consequently carries information about health. That makes treated and untreated patients systematically incomparable in the simple outcome regression.

Question

How do doctors decide whether to place their patients under medical treatment?

Answer Their patients’ health conditions.


Selection (treatment decision) model

treatment = \alpha_0 + \alpha_1 health + v

Less healthy people are more likely to be treated.

Transcript

Look at the two equations as a system. The first is the health outcome equation: health equals beta zero plus beta one times treatment plus u. Beta one represents the effect of treatment on health, and u is an unobserved health shock or other omitted health determinant. The second is the treatment-decision equation: treatment equals alpha zero plus alpha one times health plus v. Alpha one represents the response of treatment assignment to health, and v contains other determinants of treatment.

Now trace the consequence line by line. Suppose u changes, perhaps because an unobserved illness worsens. That shock directly changes health through the first equation. Health then changes treatment through the second equation. Treatment status therefore responds, indirectly, to a component of u. In probabilistic terms, treatment and u are correlated. That violates zero conditional mean in the health equation, so an OLS regression of health on treatment does not isolate beta one.

This is reverse causality because the causal arrow proposed in the research question runs from treatment to health, while another arrow runs from health back to treatment.

The final sentence on screen gives an important timing qualification. If doctors choose treatment using pre-treatment health, then later treatment cannot literally cause that earlier health. The problem is more precisely selection on baseline health, and baseline health belongs among the confounders. If current health and current treatment are jointly determined, it is genuine simultaneity or reverse causality. Under either description, the single health equation does not make treatment exogenous, and beta one is not automatically causal.

Consequence

\begin{aligned} health &= \beta_0 + \beta_1 treatment + u,\\ treatment &= \alpha_0 + \alpha_1 health + v. \end{aligned}

A shock in u changes health, and health in turn affects treatment. Consequently, treatment is correlated with u and is endogenous in the health equation.


Reverse Causality

This endogeneity problem is called reverse causality: the proposed outcome also affects the explanatory variable of interest. If treatment is chosen using pre-treatment health instead, the problem is more precisely described as selection on baseline health.

Transcript

Now we generate data from the two equations on the previous tab and see what OLS does. There are two code blocks. The first is the one-time WebR setup. It defines the lecture theme used by every plot drawn in the browser: theme B W as the base, larger axis and legend text, transparent backgrounds so the slide’s paper color shows through, and a grey grid that stays visible on that background. The WebR scale line adjusts sizes, because the browser draws its graphics at seventy-two dots per inch while the deck asks for two hundred sixteen. Theme set makes this the default for every later plot.

The second block is the simulation. Set seed makes the draws reproducible. N is one hundred observations per sample and B is one thousand repetitions. Beta one equals one is the true effect of treatment on health, the number OLS should recover if treatment were exogenous. Alpha one equals negative zero point five is the doctor’s response to health: the less healthy a patient is, the more treatment they receive. Estimate storage is a vector of B zeros that will hold one slope estimate per repetition. As the last bullet above the code says, treatment here is a continuous amount, like a dose, rather than the zero-one indicator of the earlier tabs; that keeps the two equations linear and the algebra simple. To keep the code short, both intercepts are set to zero; an intercept shifts the level of health or treatment but does not change the slope we are studying.

Inside the loop, u is the error in the health equation and v is the error in the treatment equation, each drawn as one hundred independent standard normal values. The next two lines are the heart of the design. Health and treatment are determined together, so we cannot generate one first and then the other from it. Instead, substitute the treatment equation into the health equation: health equals beta one times the quantity alpha one times health plus v, plus u. Move the health terms to the left and divide by one minus beta one times alpha one. That gives the line health equals beta one v plus u, all over one minus beta one alpha one. With health in hand, treatment equals alpha one times health plus v, exactly the treatment equation from the slide. Data frame puts the two variables side by side.

Then lm regresses health on treatment, which is the model of interest, with an intercept added automatically. Reg dollar coef bracket treatment pulls out the estimated slope, and the last line files it in position i of the storage vector. After one thousand passes, the vector holds one thousand estimates of beta one, each from a fresh sample. Move to the results tab to see where they landed.

Simulation design

  • Health equation: health = \beta_1 treatment + u, with \beta_1 = 1
  • Treatment equation: treatment = \alpha_1 health + v, with \alpha_1 = -0.5
  • Solving the two together: health = \dfrac{\beta_1 v + u}{1-\beta_1\alpha_1}
  • treatment is a continuous amount (like a dose) here, which keeps the algebra simple


Set up simulations:


Run MC simulations:

Transcript

The code turns the storage vector into a one-column data table named value, which is the form ggplot needs. Geom density maps value to the horizontal axis and draws a smoothed density of the one thousand estimates, filled grey and partly transparent. Geom v-line draws a vertical line at one, the true beta one. X-lab labels the horizontal axis, theme lecture applies the deck’s plotting style, and saving the plot as g r c lets the last line print it.

Read the figure. The horizontal axis is the estimated effect of treatment on health, and the height of the curve shows how often estimates fall near each value across the one thousand samples. The vertical line at one is the true effect. The curve sits far to the left of that line. In the run used to check this deck, the average estimate was about zero point four zero, and the largest of all one thousand estimates was about zero point seven nine. Not one sample came close to the truth. This is not bad luck in a few samples; it is a systematic shift, which is what bias means.

Why so far below one? Follow the loop of causation. A negative shock in u makes a patient less healthy. Because alpha one is negative, the doctor responds to worse health with more treatment. So treatment ends up negatively correlated with u: the patients who receive more treatment are, on average, the ones who were hit by bad health shocks. OLS compares patients with more and less treatment and attributes part of that bad-shock difference to treatment, which makes treatment look less effective than it really is. In this design the size of the gap can be worked out exactly. The covariance between treatment and u is negative one third, the variance of treatment is five ninths, and one plus negative one third divided by five ninths equals zero point four, which is exactly where the curve is centered.

The callout states the lesson. Because the problem is correlation between treatment and the error, collecting more patients does not help: with a larger sample the curve would get narrower, but it would tighten around zero point four, not around one.

Note

The estimates center around 0.4, far below the true value of 1. Treatment is correlated with u, so OLS is biased, and a larger sample would not fix it.

Transcript

This context illustrates reverse causality when the explanatory variable is a policy response. Under the Clean Water Act, facilities that discharge waste into water, such as oil refineries, must satisfy applicable discharge requirements. The EPA can respond to violations with enforcement actions, including financial penalties. Those two bullets establish both the regulated outcome and the institution choosing the treatment.

The causal research question is whether enforcement actions improve the quality of wastewater discharges. The annual facility-level data contain two types of information listed at the bottom: measures of each facility’s wastewater-discharge quality and the enforcement actions the EPA took against that facility.

Regulators observe discharge performance and tend to direct inspections, penalties, or other actions toward facilities with violations. Thus, the policy is often applied precisely where the outcome is poor or deteriorating.

Context

  • Under the Clean Water Act, facilities that discharge waste into water (e.g., oil refineries) must comply with applicable discharge requirements.

  • The Environmental Protection Agency (EPA) can take enforcement actions (e.g., financial penalties) against facilities that violate those requirements.

Research Question

Are enforcement actions effective in improving the quality of wastewater discharges?


Data

Annual data on

  • wastewater-discharge quality measures for individual facilities
  • enforcement actions taken against facilities by the EPA
Transcript

The top equation is the model of interest. Water quality equals beta zero plus beta one times enforcement actions plus u. Beta one is the policy effect we want, and u includes other observed or unobserved shocks to discharge quality that are not in this simple specification. If a larger water-quality measure means cleaner discharge, effective enforcement would imply a positive beta one.

The second equation represents the EPA’s selection decision. Enforcement actions equal alpha zero plus alpha one times water quality plus v. Alpha one describes how enforcement responds to measured quality, and v contains other influences on enforcement. When higher outcome values mean cleaner water, targeting poor quality would make alpha one negative.

The two bullets summarize the feedback: enforcement can affect water quality, and water quality can affect enforcement. More specifically, an adverse factor in u can worsen water quality and prompt an enforcement response. Enforcement is then correlated with u in the outcome equation and is endogenous.

That is the consequence printed at the bottom: enforcement actions are endogenous because they respond to the outcome itself.

Model of Interest

\text{water quality} = \beta_0 + \beta_1 \text{enforcement actions} + u


Selection (enforcement decision) model

\text{enforcement actions} = \alpha_0 + \alpha_1 \text{water quality} + v

  • water quality is affected by enforcement actions
  • enforcement actions are affected by water quality

Consequence

Enforcement actions are endogenous because they respond to water quality itself.

Transcript

You will often hear a closely related name, simultaneity, and this tab shows that it is the same problem. The textbook case is a market. The first equation is demand. Quantity equals beta zero plus beta one times price plus u, where beta one is how much buyers cut their purchases when the price rises, and u collects everything else that shifts demand, such as income or weather. The second equation is supply, written with price on the left: price equals alpha zero plus alpha one times quantity plus v, where alpha one is how much the price sellers need rises as they supply more, and v collects things that shift supply, such as input costs. The price and quantity we observe are the point where both equations hold at once, the market equilibrium.

Now trace a demand shock, exactly as the Reverse causality tab traced a health shock. A positive u raises quantity through the demand equation. Higher quantity raises price through the supply equation. So price moves with u, price is correlated with the error in the demand equation, and OLS of quantity on price does not recover the demand slope beta one.

Compare the two equations with the ones on the Reverse causality tab. There are two equations, and each variable appears on the right-hand side of the other’s equation. The structure is identical. The two names stress different things. Reverse causality stresses the direction: the outcome also affects the explanatory variable. Simultaneity stresses the timing: both are determined at the same time, typically by an equilibrium in which each equation describes a different group’s behavior, buyers and sellers here. The consequence for OLS is the same.

Simultaneity

x and y are determined at the same time, for example price and quantity in a market:

\begin{aligned} \text{demand:}\quad quantity &= \beta_0 + \beta_1 price + u,\\ \text{supply:}\quad price &= \alpha_0 + \alpha_1 quantity + v. \end{aligned}

A demand shock in u raises quantity, which raises price through supply. So price is correlated with u, and OLS of quantity on price does not recover \beta_1.


Note

Simultaneity has the same structure as reverse causality: two equations, each variable on the right-hand side of the other’s. “Reverse causality” stresses the direction (y also affects x); “simultaneity” stresses that both are set at the same time, as in a market equilibrium.

Transcript

Now find a reverse causality or simultaneity problem of your own. The examples in this section, medical treatment, EPA enforcement, and the market, share one structure, and the exercise asks you to reproduce it.

Step one asks for a pair of variables where x affects y and y also affects x. A good test is to tell the story in both directions out loud. If you can explain why x changes y and, separately, why someone sets or changes x in response to y, you have a candidate. In the first two examples the second direction came from a decision-maker reacting to the outcome: a doctor reacting to health, a regulator reacting to water quality. In the market example it came from the other side of the market: sellers’ supply links quantity back to price.

Step two is to write both equations, exactly in the form the slides used: y equals beta zero plus beta one x plus u, and x equals alpha zero plus alpha one y plus v. Say in words what beta one and alpha one mean in your example.

Step three is the chain of reasoning from the Reverse causality tab. Start with a shock in u. Say what it does to y, then what that change in y does to x. Conclude by stating how x and u are correlated.

Step four asks for the direction of the bias. The simulation tabs gave you the tool: there, beta one was positive and alpha one negative, treatment ended up negatively correlated with u, and OLS understated the effect. Work out the signs of beta one and alpha one in your example, and follow the same logic to the sign of the correlation between x and u.

Step five is the timing question from the end of the Reverse causality tab. If x responds to earlier values of y rather than to the current y, the problem is more precisely selection on the earlier outcome. Decide which description fits your example, and say why.

Exercise

Come up with your own example of reverse causality or simultaneity.

  1. Find two variables x and y where x affects y and y also affects x.
  2. Write both equations, as on the previous tabs.
  3. Trace how a shock in u ends up correlated with x.
  4. Which direction would the OLS bias go? Use the signs of \beta_1 and \alpha_1 in your example.
  5. Does x respond to the current y, or to earlier values of y? Which name, reverse causality or selection on the earlier outcome, describes your example better?

Measurement Error

Transcript

Measurement error means the value recorded in the dataset differs from the true quantity the regression is intended to use. “True” here means the underlying economic or physical variable in the model, not necessarily a value that researchers can ever observe perfectly. The gap may come from a respondent, an instrument, or an estimation procedure.

The examples show several mechanisms. In a household survey, respondents may forget, round, or deliberately misreport income and savings. Farmers in developing countries may have to recall rice yield without complete records, so the reported yield can differ from actual production. Some variables are estimated rather than observed at the relevant location. Spatially interpolated precipitation uses readings from surrounding stations to predict weather at a field, and imputed irrigation cost fills in a value using other information. Those constructed values can be useful, but they are not identical to the underlying field-level quantities.

Definition

The observed value of a variable differs from its true value.


Examples

  • reporting errors (any survey has the potential for misreporting)
    • household survey on income and savings
    • survey on rice yield by farmers in developing countries
  • the use of estimated values
    • spatially interpolated weather conditions (precipitation)
    • imputed irrigation costs

Question

What are the consequences of measurement error in variables used in a regression?

Transcript

Begin with the true model in the first line. Y star is the true dependent variable. Beta zero is the intercept; beta one through beta k are the coefficients on explanatory variables x one through x k; and u is the original structural disturbance. The slide states that the relevant OLS assumptions hold, including that the expected value of u, conditional on all the x variables, is zero.

We do not observe y star perfectly. The measurement-error definition says e equals observed y minus true y star. Rearranging that definition gives observed y equals y star plus e. A positive e means the recorded outcome is above its true value, and a negative e means it is below.

Now substitute the true model for y star. Observed y equals beta zero, plus beta one x one, continuing through beta k x k, plus u plus e. The estimable line groups the last two terms into a new composite error v, where v equals u plus e. Notice that none of the slope coefficients changed algebraically. Measurement error in y is added to the disturbance; it is not built into an explanatory variable.

For OLS slopes to remain unbiased, the new error must have conditional mean zero. The answer panel supplies the additional requirement: the expected value of e, conditional on x one through x k, must equal zero. Together with the original condition on u, this gives expected v conditional on all the x variables equal to expected u conditional on x plus expected e conditional on x, which is zero plus zero.

Intuitively, conditionally mean-zero outcome error spreads observations above and below the same regression function. When e adds noise that is uncorrelated with u, as in the usual classical case, it increases the disturbance variance, leading to less precise coefficient estimates and larger standard errors, but it does not systematically tilt the fitted relationship. This conclusion is conditional, not automatic. If high-x observations systematically overreport or underreport y, then expected e given x is not zero. For example, if high-income households underreport savings more severely, the recording error can be related to income and bias the slope.

True Model

y^*= \beta_0 + \beta_1 x_1 + \dots + \beta_k x_k + u

with the relevant OLS assumptions satisfied, including E[u\mid x_1,\dots,x_k]=0.


Measurement error

Define the difference between the observed value y and the true value y^* as

e = y-y^*


Estimable Model

Using y=y^*+e, the estimable model is

y = \beta_0 + \beta_1 x_1 + \dots + \beta_k x_k + v, \qquad v=u+e


Question

What are the conditions under which OLS estimators are unbiased?


Answer

E[e\mid x_1, \dots, x_k] = 0

Together with E[u\mid x_1,\dots,x_k]=0, this implies E[v\mid x_1,\dots,x_k]=0. Measurement error in the dependent variable then increases noise but does not bias the OLS coefficient estimators.
Transcript

This simulation checks the answer on the Setup tab. If you did the Chapter 3 exercise “Where does the noise land?”, you have already run a version of it; this time the result is tied to the condition derived on the Setup tab. We generate a true outcome, add measurement error to it, and run OLS twice in every sample: once with the true outcome, which no researcher would actually have, and once with the observed outcome, which is what a researcher would have.

Read the preparation lines first. Set seed makes the draws reproducible. N is one hundred observations per sample, and B is one thousand repetitions. Estimate storage is a matrix of zeros with B rows and two columns: column one will hold the estimate that uses the true outcome, and column two the estimate that uses the observed outcome.

Inside the loop, x is the independent variable and u is the error, both standard normal. Y star equals one plus x plus u is the true dependent variable, so the true slope is one. E is the measurement error. It is drawn with a standard deviation of two, which is large: its variance of four is four times the variance of u. It is drawn independently of x, so its mean given x is zero, which is the condition from the Setup tab. Y equals y star plus e is the outcome we observe. Data frame collects the three variables.

The two lm calls run the same regression on x, first with y star and then with y. Each reg dollar coef bracket x pulls out the slope, and the two store lines file the slopes in row i, column one and column two. After one thousand passes, each column holds one thousand estimates of the same true slope.

Simulation design

  • True model: y^* = 1 + x + u
  • Observed outcome: y = y^* + e, where e has variance 4 and is unrelated to x


Run MC simulations:

Transcript

The code first reshapes the storage matrix for ggplot. As data table turns the matrix into a data table, and melt with measure variables one and two stacks the two columns. The variable column records which column an estimate came from, and the value column holds the estimates. Geom density draws one smoothed density per column, colored by variable and partly transparent so the overlap stays visible. Geom v-line marks the true slope of one. Scale fill discrete titles the legend and replaces the column names with true y and observed y. Theme lecture applies the deck’s style, the final theme call moves the legend to the bottom, and the last line prints the saved plot.

Look at location first. Both densities are centered on the vertical line at one. In the run used to check this deck, the average estimate was about one point zero zero one with the true outcome and about one point zero zero six with the observed outcome. Measurement error in y did not push the estimates in either direction, which is what unbiasedness means.

Now look at the spread. The observed-y curve is much wider and flatter. Its standard deviation across the one thousand samples was about zero point two three, against about zero point one zero for the true-y curve. That ratio is no accident. With the true outcome the error variance is one; with the observed outcome the composite error u plus e has variance one plus four, which is five. The spread of the slope estimates grows with the square root of the error variance, and the square root of five is about two point two four, which takes zero point one zero to about zero point two two, close to what the simulation produced.

So measurement error in the dependent variable that is unrelated to x costs precision, not correctness. In any single sample the estimate is more likely to land far from one, and its standard error will be larger, but on average OLS still finds the true slope.

Note

Both are centered on the true value of 1, but the estimates with the observed y are more spread out: measurement error in y that is unrelated to x costs precision, not unbiasedness.

Transcript

Now the measurement error is in an explanatory variable. The true model says y equals beta zero plus beta one times x one star plus u. X one star is the true regressor the economic relationship calls for, beta one is its true slope effect, and u is the structural disturbance. The statement that the relevant OLS assumptions hold includes zero conditional mean for u given x one star.

The researcher observes x one rather than x one star. The definition e one equals x one minus x one star says that measurement error is the recorded value minus the true value. Rearrange it carefully: x one star equals x one minus e one. Substitute that expression into the true equation. You get y equals beta zero plus beta one times the quantity x one minus e one, plus u. Distributing beta one gives beta zero plus beta one x one plus u minus beta one e one.

The estimable model groups the last two terms into v. Thus y equals beta zero plus beta one x one plus v, where v equals u minus beta one times e one. This algebra shows the crucial contrast with dependent-variable error. The observed regressor x one contains e one because x one equals x one star plus e one. At the same time, the new regression error v contains negative beta one times that same e one. The regressor and error can therefore share a component.

OLS applied to the observed x requires the expected value of v conditional on x one to be zero. Even if u is exogenous with respect to the true regressor, that does not guarantee the new condition. We need to ask whether observed x one is related to its own measurement error e one.

True Model

Consider the following general model

y = \beta_0 + \beta_1 x_1^* + u

with the relevant OLS assumptions satisfied.


Measurement error

Define the difference between the observed value x_1 and the true value x_1^* as

e_1 = x_1-x_1^*


Estimable Model

Using x_1^*=x_1-e_1, the estimable model is

y = \beta_0 + \beta_1 x_1 + v, \qquad v=u-\beta_1 e_1


Question

OLS requires E[v\mid x_1]=0. Even when u is exogenous, this condition fails if the observed regressor x_1 is correlated with its measurement error e_1. Does classical measurement error create such a correlation?

Transcript

The definition callout lists the classical errors-in-variables assumptions. First, the expected value of e one is zero, so the measurement error has no systematic positive or negative mean. Second, the covariance between true x one star and e one is zero, so the size and direction of the recording error are unrelated to the true regressor. Third, the covariance between u and e one is zero, so measurement error is unrelated to the structural disturbance. These are strong, favorable assumptions, but they do not make the observed regressor exogenous.

Work through the three displayed covariance lines. The first replaces observed x one with its definition, x one star plus e one. We are therefore taking the covariance of x one star plus e one with e one. The second line uses covariance’s additivity: this equals the covariance of x one star with e one, plus the covariance of e one with itself. A variable’s covariance with itself is its variance, so the second term is variance of e one. The classical assumption makes the first covariance zero. The result is sigma squared sub e one, the variance of the measurement error, which is strictly positive whenever there is nondegenerate measurement error.

This is not a contradiction. E one is uncorrelated with the true x one star, but observed x one is true x one star plus e one. A high positive measurement error mechanically raises the recorded x, and a negative error lowers it. Observed x and e must therefore move together.

Finally, recall from the setup tab that v equals u minus beta one e one. Under the displayed classical assumptions and the original exogeneity assumptions, the covariance between observed x one and v includes negative beta one times the variance of e one and is generally not zero. Thus observed x one is endogenous in the estimable equation.

Definition

Under classical errors-in-variables assumptions, the measurement error has mean zero and is uncorrelated with both the true regressor and the structural error:

E[e_1]=0,\qquad \operatorname{Cov}(x_1^*,e_1)=0,\qquad \operatorname{Cov}(u,e_1)=0.

Even though e_1 is uncorrelated with x_1^*, it is correlated with the observed regressor x_1=x_1^*+e_1:

\begin{align*} \operatorname{Cov}(x_1,e_1) &=\operatorname{Cov}(x_1^*+e_1,e_1)\\ &=\operatorname{Cov}(x_1^*,e_1)+\operatorname{Var}(e_1)\\ &=\sigma_{e_1}^2>0. \end{align*}

Thus, under the classical assumptions, the mismeasured regressor is correlated with the composite error v=u-\beta_1e_1.

Transcript

The displayed probability-limit formula gives the direction of the inconsistency for this simple-regression, classical-measurement-error case. “The probability limit of beta one hat” means the value toward which the OLS slope estimate converges as the sample grows. It equals the true beta one times a fraction. The numerator is the variance of true x one star, which is the signal variation. The denominator is that same true-signal variance plus the variance of e one, the measurement-error noise. Under the classical assumption that x one star and e one are uncorrelated, that denominator is also the variance of observed x one.

The slide names this fraction lambda. Lambda is often called the reliability ratio: signal variance divided by total observed variance. When both the true regressor varies and measurement error has positive variance, lambda lies strictly between zero and one. Therefore beta one hat converges to lambda times beta one rather than to beta one itself. OLS is inconsistent, and multiplying by a positive number below one pulls the coefficient toward zero.

Use the two sign bullets to interpret the asymptotic bias, which is the probability limit of beta one hat minus beta one. If beta one is positive, lambda beta one is smaller than beta one, so the bias is negative. If beta one is negative, lambda beta one is less negative than beta one, so the bias is positive. In both cases the estimated magnitude is attenuated. “Toward zero” does not mean the estimate necessarily equals zero, and it does not mean a finite-sample estimate can never cross zero. It describes the probability limit relative to the true coefficient.

The callout’s second bullet follows directly from the ratio. Holding signal variance fixed, increasing measurement-error variance enlarges the denominator, reduces lambda, and produces stronger attenuation. With no measurement-error variance, lambda equals one and this source of inconsistency disappears. If noise dominates signal, lambda approaches zero and the probability limit is severely attenuated.

Question

So, what is the direction of the bias?


Direction of bias

Under classical measurement error,

\operatorname{plim}(\widehat{\beta}_1) =\beta_1\frac{\operatorname{Var}(x_1^*)} {\operatorname{Var}(x_1^*)+\operatorname{Var}(e_1)} =\lambda\beta_1, \qquad 0<\lambda<1.

  • If \beta_1>0, the asymptotic bias is negative.
  • If \beta_1<0, the asymptotic bias is positive.


Attenuation bias

  • The coefficient estimator is inconsistent and converges toward zero relative to the true coefficient.

  • More measurement-error variance makes the attenuation factor \lambda smaller.

Transcript

This simulation puts numbers on the attenuation formula from the previous tab. The Chapter 3 exercise “Where does the noise land?” found that noise in the regressor centered the estimates near zero point five, without a formula to say why; the formula now says why, and lets us predict where the estimates will land for any amount of noise. In every sample we record the same true independent variable twice, once with a small measurement error and once with a large one, and compare three regressions: one with the true variable, which no researcher would actually have, and one with each observed version.

The preparation lines match the earlier simulations. Set seed makes the draws reproducible, N is one hundred observations, B is one thousand repetitions, and estimate storage is now a matrix with three columns, one per regression.

Inside the loop, x one star is the true independent variable, drawn as standard normal, so its variance is one. U is the error, and y equals one plus x one star plus u, so the true slope is one. The next two lines create the observed versions. X one small e adds a measurement error with standard deviation zero point five, which is a variance of zero point two five. X one large e adds an error with standard deviation one, a variance of one. Each error is drawn independently of x one star and of u, so these are classical errors-in-variables, exactly the assumptions in the definition callout two tabs back. Data frame collects the four variables.

Before running it, predict the answer with the formula lambda equals the variance of x one star over that variance plus the variance of the error. For the small error, lambda is one over one point two five, which is zero point eight. For the large error, lambda is one over two, which is zero point five. So the formula says the two observed-x regressions should center near zero point eight and zero point five. The three lm calls regress y on each version of the variable, and the store lines file the three slopes in row i.

Simulation design

  • True model: y = 1 + x_1^* + u, with Var(x_1^*) = 1
  • Two observed versions of x_1^*, with classical errors of variance 0.25 and 1
  • The formula predicts \lambda = 1/1.25 = 0.8 and \lambda = 1/2 = 0.5


Run MC simulations:

Transcript

The code reshapes the three-column storage matrix with as data table and melt, exactly as in the dependent-variable simulation, and draws one density per column. The solid vertical line marks the true slope of one. The second geom v-line draws two dashed lines, at zero point eight and zero point five, the values the attenuation formula predicted. Scale fill discrete labels the three curves by which version of the independent variable was used, and the legend goes at the bottom.

Read the three curves against the lines. The curve for the true variable is centered on the solid line at one: in the run used to check this deck its average was about zero point nine nine. The curve for the small error is centered on the dashed line at zero point eight, with an average of about zero point seven nine. The curve for the large error is centered on the dashed line at zero point five, with an average of about zero point four nine. The formula predicted where each curve would sit, and the simulation put them there.

Two things deserve attention. First, the direction: both observed-x curves are pulled toward zero, and more error pulls harder. That is attenuation bias. Second, look at the widths. The large-error curve is not wider than the others; if anything it is slightly narrower, with a standard deviation of about zero point zero nine against about zero point one zero for the true variable. Its estimates are tightly packed around the wrong value. So a precise-looking estimate, with a small standard error, can still be badly biased. Precision tells you how much the estimate moves from sample to sample, not whether it is centered on the truth.

Compare this with the dependent-variable simulation. There, measurement error widened the curve but left it centered on one. Here, it leaves the width roughly unchanged and moves the center. Where the error enters the model decides which of the two happens.

Note

The estimates land where the formula says, at \lambda\beta_1: about 0.8 with the small error and about 0.5 with the large one. More measurement error means stronger attenuation toward zero.

Transcript

The last exercise asks for two examples of measurement error, one for each place it can enter the model, because the two places have different consequences.

Step one asks for an example where the dependent variable is measured with error and another where an independent variable is. They can come from the same study. A yield regression, for instance, could have a mismeasured outcome if yields are recalled by farmers, and a mismeasured regressor if rainfall is interpolated from distant stations.

Step two asks where the error comes from. The What is it tab gave the main sources: reporting and recall errors in surveys, and values that are estimated rather than observed, such as interpolated weather or imputed costs. Name the source in each of your examples.

Step three is the question that decides everything that follows. Is the error plausibly classical? For the dependent variable, the condition from the Setup tab is that the error has mean zero given the independent variables. For the independent variable, the conditions are the three in the classical errors-in-variables callout: mean zero, unrelated to the true value, and unrelated to u. Think about whether the size or sign of the error could depend on the true value. People with high incomes, for example, may under-report more than people with low incomes. If so, say which condition fails.

Step four asks what the error does to the OLS estimate in each example. Use the two simulations as your reference: a classical error in the dependent variable left the estimates centered on the truth but more spread out, and a classical error in an independent variable pulled them toward zero. If you decided in step three that your error is not classical, say that these conclusions may not hold, and explain why.

Exercise

Come up with your own examples of measurement error.

  1. Give one example where the dependent variable is measured with error, and one where an independent variable is.
  2. For each, explain where the error comes from.
  3. Is the error plausibly classical (mean zero, unrelated to the true value and to u)? If not, which condition fails?
  4. What does the error do to the OLS estimate in each example?

Every source is omitted variable bias

Transcript

The first slide of this lecture claimed that however endogeneity comes about, it is omitted variable bias. This slide checks that claim with one formula.

The formula is the one from Chapter 4. Suppose the error term contains some component, call it x two, that enters y with coefficient beta two. Let delta one be the slope you would get by regressing x two on x one, which is the covariance of x one and x two divided by the variance of x one. Then OLS of y on x one alone does not center on beta one. It centers on beta one plus beta two times delta one. Bias needs both pieces: the omitted component must affect y, so beta two is not zero, and it must be correlated with x one, so delta one is not zero.

For the first two sources the omitted component is easy to name, as the sentence above the table says. In the wage example it is ability, with the coefficient beta three. In the sensor example it is soil type, with the coefficient beta sub s. We did not simulate those, so the table leaves them out.

The table takes the three simulations of this lecture and asks what the omitted component was in each. Read the reverse causality row. The model of interest was health equals beta one times treatment plus u, so the omitted component is the health shock u itself, and it enters health with a coefficient of one. Its slope on treatment is the covariance of treatment and u, negative one third, divided by the variance of treatment, five ninths, which is negative zero point six. One plus one times negative zero point six is zero point four, and the simulated estimates averaged zero point four zero.

Next, measurement error in y. The observed outcome is the true outcome plus e, so the omitted component is e, again with a coefficient of one. But e was drawn independently of x, so its slope on x is zero, the formula gives one plus zero, and the simulation averaged about one point zero one. No bias, as the Setup tab argued.

Last, measurement error in x. Writing the true variable as the observed one minus the error put minus beta one times e one into the error term, so the omitted component is e one with a coefficient of negative beta one, which is negative one here. Its slope on the observed x one is the variance of e one divided by the variance of x one: zero point two five over one point two five, which is zero point two, for the small error, and one over two, which is zero point five, for the large one. The formula gives zero point eight and zero point five, and the simulations averaged zero point seven nine and zero point four nine. This is the attenuation formula from earlier, reached by a different road.

The callout gives the practical habit. Whenever you suspect endogeneity, name the component of the error that is correlated with your explanatory variable. Once it has a name, the formula tells you what to think about: whether it affects the outcome, how strongly it moves with your variable, and therefore which way your estimate is likely to be off.

The omitted variable bias formula (Chapter 4)

If the error contains a component x_2 with coefficient \beta_2, then OLS of y on x_1 centers at

\beta_1 + \beta_2\,\delta_1, \qquad \delta_1 = \frac{Cov(x_1, x_2)}{Var(x_1)}.


In the omitted variable and selection examples, the omitted components are ability and soil type. For the three simulations in this lecture:

Simulation Omitted component x_2 \beta_2 \delta_1 \beta_1 + \beta_2\delta_1 Simulated mean
Reverse causality u 1 -0.6 0.4 0.40
Measurement error in y e 1 0 1 1.01
Measurement error in x, small error e_1 -1 0.2 0.8 0.79
Measurement error in x, large error e_1 -1 0.5 0.5 0.49


Note

Endogeneity always means the error contains something correlated with the explanatory variable. Name that something, and the omitted variable bias formula tells you the direction and size of the bias.