Description Usage Arguments Value Examples
Convert List of Results to Regression Table
1 2 3 |
reg.list |
A list of regression outputs (e.g. lm objects). Should be more than one regression object. |
digits |
Number of digits to display for coefficients, standard errors. T-stats are forced to be displayed as two digits. |
fe.list |
Optional matrix/data.table of fixed effect labels to be added after the coefficients. |
coef.lab.dt |
Optional data.table of coefficient labels. Must include the following columns: (i) old.name: variable names in the dataset, (ii) new.name: variable labels to display. Regression table coefficients will be displayed in the order of the variables in this table. The table of coefficient labels can include more variables than what is included in the given regression table. |
col.names |
Optional column names to display. Default is to label columns as (1), (2), (3), etc. |
print.tstat |
Should t-stats be displayed instead of standard errors? |
sig.levels |
Levels for which significance stars should be assigned, if any. Default is 1%, 5%, 10%. |
sig.symbols |
Significance stars to be displayed. |
A formatted data.table of regression output containing coefficients, standard errors, number of observations and R-squared (or first-stage F-stat if an instrumental variables specification is supplied to felm). If the regression includes partialled-out fixed effects, the R-squared of the projected model is also displayed. Lables for fixed effects are also displayed if supplied by the user.
1 2 3 4 5 6 7 8 | reg.models <- c("mpg ~ disp", "mpg ~ disp + hp", "mpg ~ disp + hp + wt")
reg.results <- lapply(reg.models, function(x) lm(x, mtcars))
RegTable(reg.results)
coef.lab.dt <- data.table(
old.name = c("(Intercept)", "disp", "hp", "wt"),
new.name = c("Intercept", "Displacement", "Horsepower", "Weight"))
RegTable(reg.results, coef.lab.dt = coef.lab.dt, print.tstat = TRUE)
RegTable(reg.results, coef.lab.dt = coef.lab.dt[2:nrow(coef.lab.dt)])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.