modelCompare | R Documentation |
Generic function.
modelCompare(model1, model2, ...)
as.modelCompare(x)
is.modelCompare(x)
## S3 method for class 'lm'
modelCompare(model1, model2, ...)
model1 |
A fitted model object. |
model2 |
A fitted model object to compare to |
... |
Additional arguments passed to specific methods. |
x |
An object (e.g., list or a modelCompare object) to test or attempt coercing to a modelCompare object. |
Depends on the method dispatch.
m1 <- lm(mpg ~ qsec * hp, data = mtcars)
m2 <- lm(mpg ~ am, data = mtcars)
modelCompare(m1, m2)
## cleanup
rm(m1, m2)
## Not run:
m3 <- lm(mpg ~ 1, data = mtcars)
m4 <- lm(mpg ~ 0, data = mtcars)
modelCompare(m3, m4)
## cleanup
rm(m3, m4)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.