[R] re gression with multiple dependent variables?
John Sorkin
jsorkin at grecc.umaryland.edu
Wed Oct 28 11:34:55 CET 2009
Rnewb,
Have you given any thought to multivariate linear regression (i.e.
MAOVA in which there are multiple dependent variables )? This type of
regression makes a number of assumptions beyond the "usual" regression
model including multivariate normality of the outcome variables, but can
be very useful in the situation you describe.
John
John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)
>>> "Daniel Malter" <daniel at umd.edu> 10/27/2009 11:17 PM >>>
Hi, cbind the dependent variables such as in:
x=rnorm(100)
e1=rnorm(100)
e2=rnorm(100)
e3=rnorm(100)
y1=2*x+e1
y2=-1*x+e2
y3=0.7*x+e3
reg=lm(cbind(y1,y2,y3)~x)
summary(reg)
Cheers,
Daniel
-------------------------
cuncta stricte discussurus
-------------------------
-----Ursprüngliche Nachricht-----
Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
Im
Auftrag von Rnewb
Gesendet: Tuesday, October 27, 2009 9:44 PM
An: r-help at r-project.org
Betreff: [R] re gression with multiple dependent variables?
i have a series of regressions i need to run where everything is the
same
except for the dependent variable, e.g.:
lm(y1 ~ x1+x2+x3+x4+x5, data=data)
lm(y2 ~ x1+x2+x3+x4+x5, data=data)
lm(y3 ~ x1+x2+x3+x4+x5, data=data)
is it possible to run all these regs with a single command? given that
the
bulk of the work for linear regressions is inverting a matrix that
depends
only on the independent variables, it seems like a waste to do it over
and
over for each new dependent variable.
thanks,
Rnewb
--
View this message in context:
http://www.nabble.com/regression-with-multiple-dependent-variables--tp260880
25p26088025.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
R-help at 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.
______________________________________________
R-help at 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.
Confidentiality Statement:
This email message, including any attachments, is for th...{{dropped:6}}
More information about the R-help
mailing list