huxtablereg | R Documentation |
Create a huxtable object from multiple statistical models.
huxtablereg(
l,
single.row = FALSE,
stars = c(0.001, 0.01, 0.05),
custom.model.names = NULL,
custom.coef.names = NULL,
custom.coef.map = NULL,
custom.gof.names = NULL,
custom.gof.rows = NULL,
digits = 2,
leading.zero = TRUE,
star.symbol = "*",
symbol = "+",
override.coef = 0,
override.se = 0,
override.pvalues = 0,
override.ci.low = 0,
override.ci.up = 0,
omit.coef = NULL,
reorder.coef = NULL,
reorder.gof = NULL,
ci.force = FALSE,
ci.force.level = 0.95,
ci.test = 0,
groups = NULL,
custom.columns = NULL,
custom.col.pos = NULL,
...
)
l |
A statistical model or a list of statistical models. Lists of
models can be specified as |
single.row |
By default, a model parameter takes up two lines of the
table: the standard error is listed in parentheses under the coefficient.
This saves a lot of horizontal space on the page and is the default table
format in most academic journals. If |
stars |
The significance levels to be used to draw stars. Between 0 and
4 threshold values can be provided as a numeric vector. For example,
|
custom.model.names |
A character vector of labels for the models. By
default, the models are named "Model 1", "Model 2", etc. Specifying
|
custom.coef.names |
By default, texreg uses the coefficient names
which are stored in the models. The Sometimes it happens that the same variable has a different name in different models. In this case, the user can use this function to assign identical names. If possible, the rows will then be merged into a single row unless both rows contain values in the same column. Where the argument contains an See also |
custom.coef.map |
The Users must supply a named list of this form:
|
custom.gof.names |
A character vector which is used to replace the
names of the goodness-of-fit statistics at the bottom of the table. The
vector must have the same length as the number of GOF statistics in the
final table. The argument works like the |
custom.gof.rows |
A named list of vectors for new lines at the
beginning of the GOF block of the table. For example, |
digits |
Set the number of decimal places for coefficients, standard
errors and goodness-of-fit statistics. Do not use negative values! The
argument works like the |
leading.zero |
Most journals require leading zeros of coefficients and
standard errors (for example, |
star.symbol |
Alternative characters for the significance stars can be
specified. This is useful if knitr and Markdown are used for HTML
report generation. In Markdown, asterisks or stars are interpreted as
special characters, so they have to be escaped. To make a HTML table
compatible with Markdown, specify |
symbol |
If four threshold values are handed over to the |
override.coef |
Set custom values for the coefficients. New coefficients
are provided as a list of numeric vectors. The list contains vectors of
coefficients for each model. There must be as many vectors of coefficients
as there are models. For example, if there are two models with three model
terms each, the argument could be specified as |
override.se |
Set custom values for the standard errors. New standard
errors are provided as a list of numeric vectors. The list contains vectors
of standard errors for each model. There must be as many vectors of
standard errors as there are models. For example, if there are two models
with three coefficients each, the argument could be specified as
|
override.pvalues |
Set custom values for the p-values. New p-values are
provided as a list of numeric vectors. The list contains vectors of
p-values for each model. There must be as many vectors of p-values as there
are models. For example, if there are two models with three coefficients
each, the argument could be specified as |
override.ci.low |
Set custom lower confidence interval bounds. This
works like the other override arguments, with one exception: if confidence
intervals are provided here and in the |
override.ci.up |
Set custom upper confidence interval bounds. This
works like the other override arguments, with one exception: if confidence
intervals are provided here and in the |
omit.coef |
A character string which is used as a regular expression to
remove coefficient rows from the table. For example, |
reorder.coef |
Reorder the rows of the coefficient block of the
resulting table in a custom way. The argument takes a vector of the same
length as the number of coefficients. For example, if there are three
coefficients, |
reorder.gof |
Reorder the rows of the goodness-of-fit block of the
resulting table in a custom way. The argument takes a vector of the same
length as the number of GOF statistics. For example, if there are three
goodness-of-fit rows, |
ci.force |
Should confidence intervals be used instead of the default
standard errors and p-values? Most models implemented in the texreg
package report standard errors and p-values by default while few models
report confidence intervals. However, the functions in the texreg
package can convert standard errors and into confidence intervals using
z-scores if desired. To enforce confidence intervals instead of standard
errors, the |
ci.force.level |
If the |
ci.test |
If confidence intervals are reported, the |
groups |
This argument can be used to group the rows of the table into
blocks. For example, there could be one block for hypotheses and another
block for control variables. Each group has a heading, and the row labels
within a group are indented. The partitions must be handed over as a list
of named numeric vectors, where each number is a row index and each name is
the heading of the group. Example: |
custom.columns |
An optional list of additional text columns to be
inserted into the coefficient block of the table, for example coefficient
types. The list should contain one or more character vectors with as many
character or numeric elements as there are coefficients/model terms. If the
vectors in the list are named, the names are used as labels in the table
header. For example,
|
custom.col.pos |
An optional integer vector of positions for the columns
given in the |
... |
Custom options to be passed on to the |
The huxtablereg
function creates a
huxtable
object using the huxtable package.
This allows output to HTML, LaTeX, Word, Excel, Powerpoint, and RTF. The
object can be formatted using huxtable package functions. See also
huxreg
.
David Hugh-Jones
texreg-package
extract
Other texreg:
htmlreg()
,
knitreg()
,
matrixreg()
,
plotreg()
,
screenreg()
,
texreg
,
wordreg()
library("nlme")
model.1 <- lme(distance ~ age, data = Orthodont, random = ~ 1)
model.2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1)
if (requireNamespace("huxtable")) {
hr <- huxtablereg(list(model.1, model.2))
hr <- huxtable::set_bottom_border(hr, 1, -1, 0.4)
hr <- huxtable::set_bold(hr, 1:nrow(hr), 1, TRUE)
hr <- huxtable::set_bold(hr, 1, -1, TRUE)
hr <- huxtable::set_all_borders(hr, 4, 2, 0.4)
hr <- huxtable::set_all_border_colors(hr, 4, 2, "red")
hr
## Not run:
huxtable::quick_pdf(hr)
huxtable::quick_docx(hr)
# or use in a knitr document
## End(Not run)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.