createTexreg | R Documentation |
Constructor for texreg objects.
createTexreg(
coef.names,
coef,
se = numeric(0),
pvalues = numeric(0),
ci.low = numeric(0),
ci.up = numeric(0),
gof.names = character(0),
gof = numeric(0),
gof.decimal = logical(0),
model.name = character(0)
)
coef.names |
The names for the covariates in a model as a
|
coef |
The coefficients as a |
se |
The standard errors as a |
pvalues |
The p-values as a |
ci.low |
The lower bounds of the confidence intervals as a
|
ci.up |
The upper bounds of the confidence intervals as a
|
gof.names |
Names of the goodness-of-fit statistics as a
|
gof |
Goodness-of-fit statistics as a |
gof.decimal |
A |
model.name |
A name for the statistical model. Can be a |
This function creates a texreg object. A texreg
object contains information about coefficients, standard errors, p-values
(optional), and about goodness-of-fit statistics. Instead of standard
errors and p-values, a texreg object may also contain upper and
lower bounds of a confidence interval. texreg objects are used
by the texreg
function to create LaTeX tables and other
representations of the model results.
A texreg object representing the statistical model.
Philip Leifeld
Leifeld, Philip (2013). texreg: Conversion of Statistical Model Output in R to LaTeX and HTML Tables. Journal of Statistical Software 55(8): 1-24. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v055.i08")}.
extract
library("nlme") # load library for fitting linear mixed effects models
model <- lme(distance ~ age, data = Orthodont, random = ~ 1) # estimate
coefficient.names <- rownames(summary(model)$tTable) # extract coef names
coefficients <- summary(model)$tTable[, 1] # extract coefficient values
standard.errors <- summary(model)$tTable[, 2] # extract standard errors
significance <- summary(model)$tTable[, 5] #extract p-values
lik <- summary(model)$logLik # extract log likelihood
aic <- summary(model)$AIC # extract AIC
bic <- summary(model)$BIC # extract BIC
n <- nobs(model) # extract number of observations
gof <- c(aic, bic, lik, n) # create a vector of GOF statistics
gof.names <- c("AIC", "BIC", "Log Likelihood", "Num. obs.") # names of GOFs
decimal.places <- c(TRUE, TRUE, TRUE, FALSE) # last one is a count variable
# create the texreg object
tr <- createTexreg(coef.names = coefficient.names,
coef = coefficients,
se = standard.errors,
pvalues = significance,
gof.names = gof.names,
gof = gof,
gof.decimal = decimal.places)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.