getOutput | R Documentation |
Extract the coefficients and various performance measures from a regression model, and copy to the clipboard for transferring to excel.
getOutput(mod, performanceTableAtTop = TRUE, ...)
mod |
A model object. Support types include lm, glm, polr, mlogit. |
performanceTableAtTop |
(optional) parameter to determine where the performance statistics are placed. Default is at the top, but set to |
... |
(optional) additional arguments. In particular for lm and glm models the tolerance column is added by default but can be removed by setting |
Coefficient tables are relatively easy to extract from a fitted model, but this function aims to combine this table with a range of performance statistics e.g. AIC, and then copy the results directly to the clipboard.
For some models, additional columns are added to the coefficient table. For linear regressions, standardised betas are included. For lm and glm models, tolerance (1/VIF) is added (but can be removed by setting the tolerance
parameter to FALSE
. For ordinal logit models (polr) a column of p-values is added.
See also getOutputTable
# Running a linear regression on the mtcars data set...
# ...predicting miles per gallon
m1 = lm( mpg ~ cyl + disp + hp + gear + carb + gear*carb, data = mtcars)
getOutput(m1)
# output table is now copied to clipboard
# running a binary logistic regression
mLogit = glm( am ~ cyl + disp + hp ,data=mtcars,family = "binomial")
getOutput(mLogit)
# output table is now copied to clipboard
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.