Print estimated coefficients and their standard errors in a table for several regression models.
This simple function extracts estimates of regression parameters and their standard errors from one or more models and prints them in a table.
compareCoefs(..., se = TRUE, print=TRUE, digits = 3)
- One or more regression-model objects. These may be of class
nlm, or any other regression method for which the functions
vcovreturn appropriate values, or if the object
TRUE, the default, show standard errors as well as estimates, if
FALSE, show only estimates.
TRUE, the defualt, the results are printed in a nice format using
FALSE, the results are returned as a matrix
- Passed to the
printCoefmatfunction for printing the result.
- This function is used for its side-effect of printing the result. It returns a matrix of estimates and standard errors.
Fox, J. and Weisberg, S. (2011) An R Companion to Applied Regression, Second Edition, Sage.
mod1 <- lm(prestige ~ income + education, data=Duncan) mod2 <- update(mod1, subset=-c(6,16)) mod3 <- update(mod1, . ~ . + type) compareCoefs(mod1) compareCoefs(mod1, mod2) compareCoefs(mod1, mod2, mod3) compareCoefs(mod1, mod2, se=FALSE)
Looks like there are no examples yet.