| huxreg {huxtable} | R Documentation |
Create a huxtable to display model output
huxreg(..., error_format = "({std.error})", error_style = c("stderr", "ci",
"statistic", "pvalue"), error_pos = c("below", "same", "right"),
number_format = "%.3f", pad_decimal = ".", ci_level = NULL,
tidy_args = NULL, stars = c(`***` = 0.001, `**` = 0.01, `*` = 0.05),
bold_signif = NULL, borders = 0.4, outer_borders = 0.8,
note = "{stars}.", statistics = c(N = "nobs", R2 = "r.squared", "logLik",
"AIC"), coefs = NULL, omit_coefs = NULL)
... |
Models, or a single list of models. Names will be used as column headings. |
error_format |
How to display uncertainty in estimates. See below. |
error_style |
Deprecated. One or more of 'stderr', 'ci' (confidence interval), 'statistic' or 'pvalue'. |
error_pos |
Display uncertainty 'below', to the 'right' of, or in the 'same' cell as estimates. |
number_format |
Format for numbering. See |
pad_decimal |
Character for decimal point; columns will be right-padded to align these.
Set to |
ci_level |
Confidence level for intervals. Set to |
tidy_args |
List of arguments to pass to |
stars |
Levels for p value stars. Names of |
bold_signif |
Where p values are below this number, cells will be displayed in bold. Use |
borders |
Thickness of inner horizontal borders. Set to 0 for no borders. |
outer_borders |
Thickness of outer (top and bottom) horizontal borders. Set to 0 for no borders. |
note |
Footnote for bottom cell, which spans all columns. |
statistics |
Summary statistics to display. Set to |
coefs |
Display only these coefficients. Overrules |
omit_coefs |
Omit these coefficients. |
Models must have a tidy method defined, which should return 'term', 'estimate', 'std.error',
'statistic' and 'p.value'. If the tidy method does not have a conf.int option, huxreg will
calculate confidence intervals itself, using a normal approximation.
If ... has names or contains a single named list, the names will be used for column headings. Otherwise column
headings will be automatically created. If the coef and/or statistics vectors have names, these will be
used for row headings. If different values of coef have the same name, the corresponding rows will be merged
in the output.
Each element of statistics should be a column name from glance. You can also
use 'nobs' for the number of observations. If statistics is NULL then all columns from glance
will be used. To use no columns, set statistics = character(0).
error_format is a string to be interpreted by glue. Terms in parentheses will be
replaced by computed values. You can use any columns returned
by tidy: typical columns include statistic, p.value, std.error, as well as conf.low
and conf.high if you have set ci_level. For example, to show confidence intervals, you
could do error_format = "{conf.low} to {conf.high}"
A huxtable object.
set.seed(27101975) dfr <- data.frame(a = rnorm(100), b = rnorm(100)) dfr$y <- dfr$a + rnorm(100) lm1 <- lm(y ~ a, dfr) lm2 <- lm(y ~ a + b, dfr) glm1 <- glm(I(y > 0) ~ a, dfr, family = binomial) huxreg(lm1, lm2, glm1)