Re: [R] Test for equality of coefficients in multivariate multiple regression

From: John Fox <jfox_at_mcmaster.ca>
Date: Wed 19 Jul 2006 - 05:33:22 EST


Dear Ulrich,

I'll look into generalizing linear.hypothesis() so that it handles multivariate linear models.

Meanwhile, vcov(x.mlm) will give you the covariance matrix of the coefficients, so you could construct your own test by ravelling coef(x.mlm) into a vector.

I hope that this helps,
 John

On Tue, 18 Jul 2006 20:15:12 +0200
 Ulrich Keller <uhkeller@web.de> wrote:
> Hello,
>
> suppose I have a multivariate multiple regression model such as the
> following:
>
> > DF<-data.frame(x1=rep(c(0,1),each=50),x2=rep(c(0,1),50))
> > tmp<-rnorm(100)
> > DF$y1<-tmp+DF$x1*.5+DF$x2*.3+rnorm(100,0,.5)
> > DF$y2<-tmp+DF$x1*.5+DF$x2*.7+rnorm(100,0,.5)
> > x.mlm<-lm(cbind(y1,y2)~x1+x2,data=DF)
> > coef(x.mlm)
> y1 y2
> (Intercept) 0.07800993 0.2303557
> x1 0.52936947 0.3728513
> x2 0.13853332 0.4604842
>
> How can I test whether x1 and x2 respectively have the same effect on
> y1
> and y2? In other words, how can I test if coef(x.mlm)[2,1] is
> statistically equal to coef(x.mlm)[2,2] and coef(x.mlm)[3,1] to
> coef(x.mlm)[3,2]? I looked at linear.hypothesis {car} and glh.test
> {gmodels}, but these do not seem the apply to multivariate models.
> Thank you in advance,
>
> Uli Keller
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.



John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/

R-help@stat.math.ethz.ch 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. Received on Wed Jul 19 05:45:41 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 19 Jul 2006 - 06:23:33 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.