This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is There A Way To Use Anova() With Lm.Fit()

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

r

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 the lm.fit function internally, so there's no reason that lm.fit should be significantly faster, since they're both calling the same code. Check that you are using consistent settings for both.

0 answers

No answers yet.

Log in to answer this question.