View source: R/print.regexport.R
print.regexport | R Documentation |
Print methods for regexport and reglist
## S3 method for class 'regexport'
print(
reg,
order = NULL,
altnames = c(`^\\(Intercept\\)$` = "Constant"),
suppress = NULL,
digits = 3,
sumstats = c("R-squared", "Adj. R-squared", "Observations"),
notes = "*** p<0.01, ** p<0.05, * p<0.1",
siglevels = c(0.1, 0.05, 0.01),
sigformats = paste0("%1.", digits, "f", c(" ", "* ", "** ", "***"))
)
## S3 method for class 'reglist'
print(
reglist,
order = NULL,
altnames = c(`^\\(Intercept\\)$` = "Constant"),
suppress = NULL,
digits = 3,
sumstats = c("R-squared", "Adj. R-squared", "Observations"),
notes = "*** p<0.01, ** p<0.05, * p<0.1",
siglevels = c(0.1, 0.05, 0.01),
sigformats = paste0("%1.", digits, "f", c(" ", "* ", "** ", "***"))
)
reg |
A regression model |
order |
A list of variable names to move to the top of the output table in the order specified |
suppress |
A regular expression or vector of regressors to be suppressed from the output (useful for fixed effects) |
digits |
The number of digits to use for rounding |
sumstats |
Which summary statistics to output in the table |
notes |
A character with notes to be shown at the bottom of the output |
siglevels |
A numeric vector with significance levels below which special formatting will be used (typically stars); levels should be ordered from least to most significant (i.e. largest to smallest) |
sigformats |
A character vector with |
alt.names |
A named character vector giving the alternative names for input variables; the vector results will replace the names |
These methods produce nicely formatted console output for objects of class regexport or reglist. The output captured here is nice enough for many purposes, such as quick sharing in e-mail. For more professional outputs, the other functions in this package will be more suitable.
as.data.frame.reglist
is at the core of these methods; converting a
reglist
object to a data frame will yield a data frame which will
look essentially the same when printed, except without the notes. This
could be useful for output to a csv file or other purposes.
test <- list(lm(mpg~cyl+disp, data = mtcars),
lm(mpg~cyl+disp+hp, data = mtcars),
lm(mpg~cyl+disp+hp+drat, data = mtcars),
lm(mpg~hp+drat+wt, data = mtcars))
test <- as.regexport(test)
print(test) # An object of class reglist
test <- test[[1]]
print(test) # An object of class regexport
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.