Qual è la relazione tra R-quadrato e valore p in una regressione?


17

tl; dr - per la regressione OLS, un R-quadrato più alto implica anche un valore P più alto? In particolare per una singola variabile esplicativa (Y = a + bX + e) ​​ma sarebbe anche interessato a conoscere n più variabili esplicative (Y = a + b1X + ... bnX + e).

Contesto: sto eseguendo la regressione OLS su un intervallo di variabili e sto cercando di sviluppare la migliore forma funzionale esplicativa producendo una tabella contenente i valori R al quadrato tra le trasformazioni lineari, logaritmiche, ecc. Di ciascuna variabile esplicativa (indipendente) e la variabile di risposta (dipendente). Questo assomiglia un po 'a:

Nome della variabile --lineare-- --ln (variabile) --exp (variabile) - ... ecc

Variabile 1 ------- R-quadrato ---- R-quadrato ---- R-quadrato -
... ecc ...

Mi chiedo se R-quadrato sia appropriato o se i valori di P siano migliori. Presumibilmente c'è qualche relazione, poiché una relazione più significativa implicherebbe un potere esplicativo più elevato, ma non sono sicuro che ciò sia vero in modo rigoroso.


5
Anche di interesse: R ^ 2 è utile o pericoloso? .
whuber

Risposte:


15

La risposta è no, non esiste una relazione così regolare tra R2 e il valore p di regressione generale, perché R2 dipende tanto dalla varianza delle variabili indipendenti quanto dalla varianza dei residui (a cui è inversamente proporzionale) e sei libero di modificare la varianza delle variabili indipendenti di importi arbitrari.

Come esempio, considerare ogni insieme di dati multivariati con i indicizzazione casi e supponiamo che l'insieme dei valori della prima variabile indipendente, { x i 1 } , ha un unico massimo x separato dal secondo valore più alto da un importo positivo ϵ . Applicare una trasformazione non lineare della prima variabile che invia tutti i valori meno di((xi1,xi2,,xip,yi))i{xi1}xϵxϵ/2 all'intervallo[0,1] e inviax stesso a un valore di grandi dimensioniM1 . Per qualsiasi simile,Mciò può essere fatto mediante una trasformazione Box-Cox (ridimensionata) adattaxa((xx0)λ1)/(λ1)) , ad esempio, quindi non stiamo parlando di qualcosa di strano o "patologico". Quindi, comeMcresce arbitrariamente grande, avvicina a 1 quanto più ti piace, indipendentemente da quanto sia grave l'adattamento, perché la varianza dei residui sarà limitata mentre la varianza della prima variabile indipendente è asintoticamente proporzionale a M 2 .R21M2


Si dovrebbe essere invece di usare la bontà dei test in forma (tra le altre tecniche) per selezionare un modello adeguato nella vostra esplorazione: si dovrebbe essere preoccupato per la linearità della forma e della omoschedasticità dei residui. E non prendere alcun valore p dalla risultante regressione sulla fiducia: finiranno per essere quasi insignificanti dopo aver svolto questo esercizio, perché la loro interpretazione presuppone che la scelta di esprimere le variabili indipendenti non dipenda dai valori della variabile dipendente, il che non è affatto il caso qui.


10

Questa risposta non affronta direttamente la domanda centrale; non è altro che alcune informazioni aggiuntive troppo lunghe per un commento.

Lo sottolineo perché la domanda econometricstats incontrerà senza dubbio queste informazioni, o qualcosa del genere ad un certo punto (affermando che e R 2 sono correlati) e mi chiedo se le informazioni fornite in altre risposte qui siano sbagliate - non è sbagliato - ma penso paga essere chiari su ciò che sta succedendo.FR2

C'è una relazione in un particolare insieme di circostanze; se si tiene il numero di osservazioni e il numero di predittori fissi per un dato modello, è in effetti monotonico in R 2 , poichéFR2

F=R2/(k1)(1R2)/(Nk)

(Se dividi numeratore e denominatore per e estrai le costanti in k , puoi vedere 1 / F 1 / R 2 - 1 se mantieni costante N e k .)R2k1/F1/R21Nk

Poiché per df fisso e il valore p sono monotonicamente correlati, anche R 2 e il valore p sono monotonicamente correlati.FR2p

Ma cambia quasi tutto sul modello e quella relazione non tiene conto delle circostanze mutate.

Ad esempio, aggiungere un punto rende più grande e rimuoverne uno più piccolo ma farlo può aumentare o diminuire R 2 , quindi sembra che F e R 2 non si muovano necessariamente insieme se aggiungi o elimini dati. L'aggiunta di una variabile diminuisce ( N - k ) / ( k - 1 ) ma aumenta R 2 (e viceversa), quindi di nuovo R 2 non è necessariamente correlato a(Nk)/(k1)R2FR2 (Nk)/(k1)R2R2 quando lo fai.F

Clearly, once you compare R2 and p-values across models with different characteristics, this relationship doesn't necessarily hold, as whuber proved in the case of nonlinear transformations.


I don't disagree with you, but it looks like you're answering a different question than I did. It took some reading, but I concluded that the question asks about what relationship, if any, holds between p and R2 when (caeteris paribus) independent variables are nonlinearly transformed. It is only when those variables are left unchanged--or, at most, linearly transformed among themselves--that we can say anything at all about such a relationship. That is part of the sense in which I think your qualifier "for a given model" has to be understood.
whuber

I am answering a different question; and I believe your interpretation of the meaning is correct. I was more worried that such an issue as the one I raised would lead to confusion if not explained. All your points hold, to my understanding. (Now I'm concerned, in fact, that perhaps my answer doesn't serve to clarify, as I had hoped, but merely confuses the issue. Do you think there's a suitable modification that would help it? Should I delete it?)
Glen_b -Reinstate Monica

I would hate to see it deleted, Glen. If you intend to make changes, consider more explicitly pointing out which aspects of this issue you are writing about (e.g., what precisely you mean by a "given model" and what you have in mind about models with "different characteristics"). This was the spirit (collaborative, not critical) in which I offered my comment.
whuber

I didn't feel criticized by you - you seemed to be clarifying and nothing more - but the need for it highlights an inadequacy in the answer I had been concerned about before you commented. The vagueness of 'different characteristics' are because it's a pretty general thing - vary much of anything (I even give examples of something as simple as removing a point or adding a variable to illustrate how little one needs to change) can make that monotonic relationship evaporate. I'll think about what more I might say.
Glen_b -Reinstate Monica

+1 for the edit: these are valuable comments and it's especially useful to see the formula for F appear.
whuber

3

"for OLS regression, does a higher R-squared also imply a higher P-value? Specifically for a single explanatory variable (Y = a + bX + e) "

Specifically for a single explanatory variable, given the sample size, the answer is yes. As Glen_b has explained, there is a direct relationship between R2 and the test statistic (be it a F or t). For instance, as explained in this other question (High R2 squared and high p-value for simple linear regression) for the simple linear regression with one covariate (and a constant), the relationship between t and R2 is:

|t|=R2(1R2)(n2)

So in this case, once you fix n, the higher the R2 the higher the t statistic and the lower the p-value.

"but would also be interested to know for n multiple explanatory variables (Y = a + b1X + ... bnX + e)."

The answer is the same, but instead of looking at one variable only, we now look at all variables together -- hence the F statistic, as Glen_b has shown. And here you have to fix both n and the number of parameters. Or, to put it better, fix the degrees of freedom.

Context - I'm performing OLS regression on a range of variables and am trying to develop the best explanatory functional form (...)

Ok, so this is actually a different problem. If you are looking at the best explanatory functional form, you should also take a look at cross-validation techniques. Even if R2 is the quantity of interest for your problem (it usually isn't), finding the best fit in-sample can be very misleading -- you usually want your findings to generalize out of sample, and proper cross-validation can help you not overfit your data too much.

And here I'm guessing that you want "predictive" power (since you say you want to find "the best explanatory functional form"). If you want to do causal inference, for instance, then the R2 or other predictive performance metrics are of little help without more structural/substantive knowledge of the problem.

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.