Entering edit mode
11.3 years ago
mdwain.uw
•
0
Hi,
To do ANOVA analysis , i typically do a anova(lm()) call in R.
However, I'm running this command hundreds of thousands of times, and lm() is quite slow --- I've found lm.fit() to work much faster. Is there a way to use anova() with lm.fit() though? lm.fit() returns a list() object, not a lm object...
You would properly have to read through the source code of the anova function to find out exactly what it expects. Alternatively, since these are all independent tests, you could probably speed it up quite a bit with some simple parallisation using e.g. foreach.
The
lm
function calls thelm.fit
function internally, so there's no reason thatlm.fit
should be significantly faster, since they're both calling the same code. Check that you are using consistent settings for both.