another approach is:
Df <- as.data.frame(cbind(rcauchy(100), matrix(runif(100*50), ncol = 50)))
fit <- lm(V1 ~ ., data = Df)
fit
I hope it helps.
Best,
Dimitris
On 8/17/2011 3:28 PM, R. Michael Weylandt wrote:
The most elegant solution is going to depend on where you data comes from,
but one way to do it if you have a matrix of data:
D = cbind(rcauchy(100), matrix(runif(100*50),ncol=50)) # Some nonsense data
lm(D[,1] ~ D[,-1])
If you let us know how your data is set up, a more specific response can be
given.
Hope this helps,
Michael Weylandt
On Wed, Aug 17, 2011 at 9:23 AM, carol white<wht_...@yahoo.com> wrote:
Hello,
It might be an easy question but if you have many variables to fit in the
lm function, how do you take all without specifying var1+var2+...+var2100 in
the terms parameter in response ~ terms?
Cheers,
Carol
______________________________________________
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]]
______________________________________________
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.
--
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus University Medical Center
Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014
Web: http://www.erasmusmc.nl/biostatistiek/
______________________________________________
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.