getOutput: Get Regression Table (to clipboard)

View source: R/getOutput.R

getOutputR Documentation

Get Regression Table (to clipboard)

Description

Extract the coefficients and various performance measures from a regression model, and copy to the clipboard for transferring to excel.

Usage

getOutput(mod, performanceTableAtTop = TRUE, ...)

Arguments

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 FALSE to place at the bottom.

...

(optional) additional arguments. In particular for lm and glm models the tolerance column is added by default but can be removed by setting tolerance = FALSE.

Details

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

See also getOutputTable

Examples


# 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


Dectech/DectechR documentation built on Feb. 15, 2024, 9:17 a.m.