texreg(l, single.row=FALSE, no.margin=TRUE, leading.zero=TRUE,
table=TRUE, sideways=FALSE, float.pos="", stars=TRUE,
strong.signif=FALSE, symbol="\\cdot", use.packages=TRUE,
caption="Statistical models", label="table:coefficients",
dcolumn=TRUE, booktabs=TRUE, scriptsize=FALSE,
custom.names=NA, model.names=NA, digits=2, override.se=0,
override.pval=0, omit.coef=NA, ...)l = list(model.1, model.2, ...). Different object types can also be mixed.single.rno.margin=FALSE.0.35). This is also the default texreg behavior. Some journals, however, require omission of leading zeros (for example, .35). This can be achitabular object in a table floating environment. To get only the tabular object without the whole table header, set table=FALSE.sideways=TRUE is set, the table floating environment is replaced by a sidewaystable float, and the rotating package is loaded in the preamble. The argument only has an effect if table=TRUEh (here), p (pagsymbol="\\cdot") when strong.signif=TRUE is set. Any other mathematical LaTeX symbol can be used, for example symbol="\\circ".TRUE (= the default behavior), the required LaTeX packages are loaded in the beginning. If set to FALSE, the use package statements are omitted from the output.table environment.table environment.dcolumn LaTeX package to get a nice alignment of the coefficients.booktabs LaTeX package to get thick horizontal rules in the output table.scriptsize=TRUE.custom.names argument can be used to replace them by other character strings in the order of appearance. For example, if a table shows a total of three differenmodel.names=c("My name 1", "My name 2") etc. overrides the default behavior.omit.coef="group" deletes all coefficient rows from the table where the name of the coefficient contains the character sequence "texreg-package extract extract-methods#Linear mixed-effects models
library(nlme)
model.1 <- lme(distance ~ age, data = Orthodont, random = ~ 1)
model.2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1)
table.string <- texreg(list(model.1, model.2))
cat(table.string)
#Ordinary least squares model (example from the 'lm' help file)
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2,10,20, labels=c("Ctl","Trt"))
weight <- c(ctl, trt)
lm.D9 <- lm(weight ~ group)
table.string <- texreg(lm.D9)
cat(table.string)Run the code above in your browser using DataLab