In che modo il termine di errore di regressione può mai essere correlato con le variabili esplicative?


22

La prima frase di questa pagina wiki afferma che "In econometria, si verifica un problema di endogeneità quando una variabile esplicativa è correlata al termine di errore. 1 "

La mia domanda è che come può mai accadere? La regressione beta non è scelta in modo tale che il termine di errore sia ortogonale allo spazio della colonna della matrice di progettazione?


9
La beta di regressione è scelta in modo tale che il residuo sia ortogonale allo spazio della colonna della matrice di progettazione. E questo può dare una stima orribile della vera beta se il termine di errore non è ortogonale allo spazio della colonna della matrice di progettazione! (ovvero se il tuo modello non soddisfa i presupposti necessari per stimare coerentemente i coefficienti in base alla regressione).
Matthew Gunn,

3
L'ortogonalità del termine di errore e lo spazio di colonna della matrice di progettazione non è una proprietà del metodo di stima (ad es. Regressione dei minimi quadrati ordinari), è una proprietà del modello (ad es. yi=a+bxi+ϵi ).
Matthew Gunn,

Penso che la tua modifica dovrebbe essere una nuova domanda perché sembra che tu abbia cambiato sostanzialmente quello che stai chiedendo. Puoi sempre ricollegarti a questo. (Penso che anche tu debba esprimerlo meglio - quando scrivi "quale sarebbe l'effetto", allora non sono chiaro sull'effetto di cosa ?) Nota che fare una nuova domanda in genere produce più attenzione che sarebbe un vantaggio per te oltre a modificarne uno esistente.
Silverfish

Risposte:


28

Stai combinando due tipi di termine "errore". Wikipedia in realtà ha un articolo dedicato a questa distinzione tra errori e residui .

In una regressione OLS, i residui (le stime del termine di errore o ε^ sono infatti garantiti per essere correlata con le variabili predittive, assumendo la regressione contiene un termine di intercetta.

Ma gli errori "veri" ε possono ben essere correlati con essi, e questo è ciò che conta come endogeneità.

Per semplificare le cose, considera il modello di regressione (potresti vederlo descritto come il " processo di generazione di dati " sottostante o "DGP", il modello teorico che assumiamo per generare il valore di y ):

yi=β1+β2xi+εi

Non vi è alcun motivo, in linea di principio, per cui x non possa essere correlato con ε nel nostro modello, per quanto preferiremmo che non violasse le ipotesi OLS standard in questo modo. Ad esempio, potrebbe essere che y dipenda da un'altra variabile che è stata omessa dal nostro modello, e questo è stato incorporato nel termine di disturbo ( ε è il punto in cui raggruppiamo tutte le cose diverse da x che influenzano y ). Se questa variabile omessa è anche correlata con x , allora ε sarà a sua volta correlata con x e avremo endogeneità (in particolare, distorsione da variabile omessa ).

Quando stimate il vostro modello di regressione sui dati disponibili, otteniamo

yi=β^1+β^2xi+ε^i

A causa del modo OLS opere *, i residui ε saranno correlati con x . Ma questo non significa che dobbiamo endogenità evitato - significa solo che non possiamo rilevarlo analizzando la correlazione tra ε e x , che sarà (fino a errore numerico) nullo. E poiché le ipotesi di OLS sono state violate, non ci sono più garantite le belle proprietà, come l'imparzialità, ci piace così tanto di OLS. La nostra stima β 2 sarà distorto.ε^xε^xβ^2


Il fatto che ε è correlata con x segue immediatamente dalle equazioni "normali" che usiamo per scegliere i nostri migliori stime per i coefficienti.()ε^x

Se non sei abituato all'impostazione della matrice e mi attengo al modello bivariato usato nel mio esempio sopra, la somma dei residui quadrati è e di trovare l'ottimale b 1 = β 1 e b 2 =S(b1,b2)=i=1nεi2=i=1n(yib1b2xi)2b1=β^1che minimizza questo, troviamo le equazioni normali, in primo luogo la condizione del primo ordine per l'intercetta stimata:b2=β^2

Sb1=i=1n2(yib1b2xi)=2i=1nε^i=0

che mostra che la somma (e quindi media) dei residui è zero, quindi la formula per la covarianza tra ε e ogni variabile x poi riduce a 1ε^x1n1i=1nxiε^i. We see this is zero by considering the first-order condition for the estimated slope, which is that

Sb2=i=1n2xi(yib1b2xi)=2i=1nxiε^i=0

If you are used to working with matrices, we can generalise this to multiple regression by defining S(b)=εε=(yXb)(yXb); the first-order condition to minimise S(b) at optimal b=β^ is:

dSdb(β^)=ddb(yybXyyXb+bXXb)|b=β^=2Xy+2XXβ^=2X(yXβ^)=2Xε^=0

XXε^. Then if the design matrix X has a column of ones (which happens if your model has an intercept term), we must have i=1nε^i=0 so the residuals have zero sum and zero mean. The covariance between ε^ and any variable x is again 1n1i=1nxiε^i and for any variable x included in our model we know this sum is zero, because ε^ is orthogonal to every column of the design matrix. Hence there is zero covariance, and zero correlation, between ε^ and any predictor variable x.

y^y y^ is constrained to the column space of the design matrix X, dictate that y^ should be the orthogonal projection of the observed y onto that column space. Hence the vector of residuals ε^=yy^ is orthogonal to every column of X, including the vector of ones 1n if an intercept term is included in the model. As before, this implies the sum of residuals is zero, whence the residual vector's orthogonality with the other columns of X ensures it is uncorrelated with each of those predictors.

Vectors in subject space of multiple regression

εε^xβ^ The way we selected our β^ affects our predicted values y^ and hence our residuals ε^=yy^. If we choose β^ by OLS, we must solve the normal equations and these enforce that our estimated residuals ε^ are uncorrelated with x. Our choice of β^ affects y^ but not E(y) and hence imposes no conditions on the true errors ε=yE(y). It would be a mistake to think that ε^ has somehow "inherited" its uncorrelatedness with x from the OLS assumption that ε should be uncorrelated with x. The uncorrelatedness arises from the normal equations.


1
does your yi=β1+β2xi+εi mean regression using population data? Or what does it mean precisely?
denizen of the north

@user1559897 Yes, some textbooks will call this the "population regression line" or PRL. It's the underlying theoretical model for the population; you may also see this called the "data generating process" in some sources. (I tend to be a bit careful about saying it is the "regression on the population"... if you have a finite population, e.g. 50 states of the USA, that you perform the regression on, then this isn't quite true. If you are actually running a population on some data in your software, you are really talking about the estimated version of the regression, with the "hats")
Silverfish

I think i see what you are saying. If i understand you correctly, the error term in the model yi=β1+β2xi+εi could have non-zero expectation as well because it is a theoretical generating process, not a ols regression.
denizen of the north

This is a great answer from statistical inference perspective. What do you think the effect would be if prediction accuracy is the primary concern? See the edit of the post.
denizen of the north

16

Simple example:

  • Let xi,1 be the number of burgers I buy on visit i
  • Let xi,2 be the number of buns I buy.
  • Let b1 be the price of a burger
  • Let b2 be the price of a bun.
  • Independent of my burger and bun purchases, let me spend a random amount a+ϵi where a is a scalar and ϵi is a mean zero random variable. We have E[ϵi|X]=0.
  • Let yi be my spending on a trip to the grocery store.

The data generating process is:

yi=a+b1xi,1+b2xi,2+ϵi

If we ran that regression, we would get estimates a^, b^1, and b^2, and with enough data, they would converge on a, b1, and b2 respectively.

(Technical note: We need a little randomness so we don't buy exactly one bun for each burger we buy at every visit to the grocery store. If we did this, x1 and x2 would be collinear.)

An example of omitted variable bias:

Now let's consider the model:

yi=a+b1xi,1+ui

Observe that ui=b2xi,2+ϵi. Hence

Cov(x1,u)=Cov(x1,b2x2+ϵ)=b2Cov(x1,x2)+Cov(x1,ϵ)=b2Cov(x1,x2)

Is this zero? Almost certainly not! The purchase of burgers x1 and the purchase of buns x2 are almost certainly correlated! Hence u and x1 are correlated!

What happens if you tried to run the regression?

If you tried to run:

yi=a^+b^1xi,1+u^i

Your estimate b^1 would almost certainly be a poor estimate of b1 because the OLS regression estimates a^,b^,u^ would be constructed so that u^ and x1 are uncorrelated in your sample. But the actual u is correlated with x1 in the population!

What would happen in practice if you did this? Your estimate b^1 of the price of burgers would ALSO pickup the price of buns. Let's say every time you bought a $1 burger you tended to buy a $0.50 bun (but not all the time). Your estimate of the price of burgers might be $1.40. You'd be picking up the burger channel and the bun channel in your estimate of the burger price.


I like your burger bun example. You explained the problem from the perspective of statistical inference, ie inferring the effect of burger on price. Just wondering what the effect would be if all I care about is prediction, i.e prediction MSE on a test dataset? The intuition is that it is not going to be as good, but is there any theory to make it more precise? (this introduced more bias, but less variance, so the overall effect is not apparent to me. )
denizen of the north

1
@user1559897 If you just care about predicting spending, then predicting spending using the number of burgers and estimating b^1 as around $1.40 might work pretty well. If you have enough data, using the number of burgers and buns would undoubtedly work better. In short samples, L1 regularlization (LASSO) might send one of the coefficients b1 or b2 to zero. I think you're correctly recognizing that what you're doing in regression is estimating a conditional expectation function. My point is for that that function to capture causal effects, you need additional assumptions.
Matthew Gunn

3

Suppose that we're building a regression of the weight of an animal on its height. Clearly, the weight of a dolphin would be measured differently (in different procedure and using different instruments) from the weight of an elephant or a snake. This means that the model errors will be dependent on the height, i.e. explanatory variable. They could be dependent in many different ways. For instance, maybe we tend to slightly overestimate the elephant weights and slightly underestimate the snake's, etc.

So, here we established that it is easy to end up with a situation when the errors are correlated with the explanatory variables. Now, if we ignore this and proceed to regression as usual, we'll notice that the regression residuals are not correlated with the design matrix. This is because, by design the regression forces the residuals to be uncorrelated. Note, also that residuals are not the errors, they're the estimates of errors. So, regardless of whether the errors themselves are correlated or not with the independent variables the error estimates (residuals) will be uncorrelated by the construction of the regression equation solution.

Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.