I'm wondering if there's an easy way of calculating an F-statistic / p-value for a subset of model coefficients. Particularly in R? I'm not sure what test would be needed to calculate this. For example,
summary(lm(a~w+x+y+z))
will give me the F-statistic and p-value for the whole model, but is it possible to extract the F-statistic and p-value for just the terms y and z?
A faster way of doign something like this:
matrixOfResponses <- cbind(c(1,2,3,4,5), c(4,3,2,4,5), c(5,3,2,23,4), c(1,2,4,3,1,))
pValsOut <- numeric()
for(i in 1:ncol(matrixOfResponses))
{
pValsOut[i] <- anova(lm(matrixOfResponses[,i]~mMat), lm(matrixOfResponses[,i]~mMatReduced))$'Pr(>F)'[2]
}
So basically something like the above becomes very slow when "matrixOfRespones" contains a huge number of variables, for example a huge number of gene expression levels.