Displaying 2 results from an estimated 2 matches for "anovaresult".
Did you mean:
anovaresults
2003 Sep 05
2
stack overflow
...tion <- gl(2,8,16, label=c("no infection", "infection"))
> labor <- gl(2,4,16, label=c("no labor", "labor"))
> aof <- function(x) {
+ m <- data.frame(infection, labor, x);
+ anova(aov(x ~ infection + labor + infection*labor, m))
+ }
> anovaresults <- apply(sdata, 1, aof)
> pvalues <- data.frame(lapply(anovaresults, function(x) { x["Pr(>F)"][1:3,] }))
Error: protect(): stack overflow
> anovaresults[[1]]
Analysis of Variance Table
Response: x
Df Sum Sq Mean Sq F value Pr(>F)
infection 1...
2008 Apr 03
1
getting serial anovas from a complex lm object obtained with a matrix of responses
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...