[R] getting serial anovas from a complex lm object obtained with a matrix of responses

From: Mark Kimpel <mwkimpel_at_gmail.com>
Date: Thu, 03 Apr 2008 10:00:18 -0400

I have fit a model to ~20k different genes and would now like to extract the p-val for one of the effects, again for each individual gene.

My model code is:
mod <- lm(myResponseMatrix~ Time)

Were I to do this with a response vector rather than matrix, the following would work:
anovaResult<- anova(mod)

With a more complex lm object, such as that generated above, it seems anova is trying to compare all the models to each other, a Herculean task for ~20k models and NOT what I want.

Without resorting to a slow loop/apply approach, is there a way to get lightening fast anova results in a fashion similar to that obtained from lm?


Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine

15032 Hunter Court, Westfield, IN 46074

(317) 490-5129 Work, & Mobile & VoiceMail
(317) 663-0513 Home (no voice mail please)
****************************************************************** [[alternative HTML version deleted]] ______________________________________________ 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.
Received on Thu 03 Apr 2008 - 14:07:44 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 Apr 2008 - 10:30:26 GMT.

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

list of date sections of archive