Michael
2012-Jan-27 04:59 UTC
[R] Is there a R command for testing the difference of two liear regressions?
Hi al, I am looking for a R command to test the difference of two linear regressoon betas. Lets say I have data x1, x2...x(n+1). beta1 is obtained from regressing x1 to xn onto 1 to n. beta2 is obtained from regressing x2 to x(n+1) onto 1 to n. Is there a way in R to test whether beta1 and beta2 are statistically different? Thanks a lot! [[alternative HTML version deleted]]
Mark Leeds
2012-Jan-27 05:29 UTC
[R] Is there a R command for testing the difference of two liear regressions?
I don't know what is available in R but a relevant paper that provides a test is by Hotelling, H ( September, 1940 ) "The Selection of Variates For Use in Prediction With Some Comments On The General Problem of Nuisance Parameters". Annals of Mathematical Statistics, 11, 271-283. On Thu, Jan 26, 2012 at 11:59 PM, Michael <comtech.usa@gmail.com> wrote:> Hi al, > > I am looking for a R command to test the difference of two linear > regressoon betas. > > Lets say I have data x1, x2...x(n+1). > beta1 is obtained from regressing x1 to xn onto 1 to n. > > beta2 is obtained from regressing x2 to x(n+1) onto 1 to n. > > Is there a way in R to test whether beta1 and beta2 are statistically > different? > > Thanks a lot! > > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > >[[alternative HTML version deleted]]
Richard M. Heiberger
2012-Jan-27 19:29 UTC
[R] Is there a R command for testing the difference of two liear regressions?
It looks like you might be asking for the anova() on two models. M1 <- lm(y ~ x1 + x2 + x3, data=something) M2 <- lm(y ~ x2 + x3, data=something) anova(M1, M2) Please send a reproducible example to the list if more detail is needed. Rich On Thu, Jan 26, 2012 at 11:59 PM, Michael <comtech.usa@gmail.com> wrote:> Hi al, > > I am looking for a R command to test the difference of two linear > regressoon betas. > > Lets say I have data x1, x2...x(n+1). > beta1 is obtained from regressing x1 to xn onto 1 to n. > > beta2 is obtained from regressing x2 to x(n+1) onto 1 to n. > > Is there a way in R to test whether beta1 and beta2 are statistically > different? > > Thanks a lot! > > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > >[[alternative HTML version deleted]]