Is There A Way To Use Anova() With Lm.Fit()
0
0
Entering edit mode
10.7 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...

r • 2.4k views
ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 1365 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6