On Aug 17, 2011, at 10:39 AM, carol white wrote:

Thanks for your all replies.

Actually, I have more than this number of variables. I want to make a selection of variables with anova and I thought that I can apply anova to the object obtained by lm. The purpose is to select the genes discriminting control samples from disease.


You need to consult a statistician with experience in this area.

--
David.

Best,

Carol

----- Original Message -----
From: Eik Vettorazzi <e.vettora...@uke.uni-hamburg.de>
To: carol white <wht_...@yahoo.com>
Cc: "r-h...@stat.math.ethz.ch" <r-h...@stat.math.ethz.ch>
Sent: Wednesday, August 17, 2011 3:39 PM
Subject: Re: [R] too many var in lm

Hi Carol,
it might be another question if it is sensible to use 2100 regression
parameters, but you can use . to regress one response against all other
variables in a data frame as in:

lm(formula = mpg ~ ., data = mtcars)

and you can even exclude specific variables using "-"
lm(formula = mpg ~ . - wt, data = mtcars)

cheers.

Am 17.08.2011 15:23, schrieb carol white:
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.

--
Eik Vettorazzi

Department of Medical Biometry and Epidemiology
University Medical Center Hamburg-Eppendorf

Martinistr. 52
20246 Hamburg

T ++49/40/7410-58243
F ++49/40/7410-57790


______________________________________________
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.

David Winsemius, MD
West Hartford, CT

______________________________________________
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.

Reply via email to