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=NULL, custom.gof.names=NULL, model.names=NULL,
digits=2, override.coef=0, override.se=0, override.pval=0,
omit.coef=NA, reorder.coef=NULL, reorder.gof=NULL, file=NA,
return.string=FALSE, caption.above=FALSE, ...)
htmlreg(l, single.row=FALSE, leading.zero=TRUE, stars=TRUE,
strong.signif=FALSE, symbol="·",
caption="Statistical models", custom.names=NULL,
custom.gof.names=NULL, model.names=NULL, digits=2,
doctype=TRUE, star.symbol="*", align.center=FALSE,
override.coef=0, override.se=0, override.pval=0,
omit.coef=NA, reorder.coef=NULL, reorder.gof=NULL, file=NA,
return.string=FALSE, ...)
screenreg(l, single.row=FALSE, leading.zero=TRUE, stars=TRUE,
strong.signif=FALSE, custom.names=NULL, custom.gof.names=NULL,
model.names=NULL, digits=2, outer.rule="=", inner.rule="-",
column.spacing=2, override.coef=0, override.se=0,
override.pval=0, omit.coef=NA, reorder.coef=NULL,
reorder.gof=NULL, file=NA, return.string=FALSE, ...)
l = list(model.1, model.2, ...)
. Different object types can also be mixed.single.r
no.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=TRUE
h
(here), p
(pagsymbol="\\cdot"
for the LaTeX dot or symbol="·"
for the HTML dot) when strong.signif=TRUE
is set. Any other mathematicaTRUE
(= 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.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 differencustom.names
model.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 "reorder.coef=c(3, 2, 1)
will put thereorder.gof=c(3, 2, 1)
cat()
function?screenreg()
function). If an empty character object is provided (i.e., outer.rule=""
), there will be no outer horizontal lines. Rscreenreg()
function). If an empty character object is provided (i.e., outer.rule=""
), there will be no inner horizontal lines. Rhtmlreg()
function: should the first line of the HTML code contain the DOCTYPE definition? If TRUE
, the HTML 5 version is used. If FALSE
, no DOCTYPE will be included. Omitting the DOCTYPE can be helpful when htmlreg()
function: alternative characters for the significance stars can be specified. This is useful if htmlreg()
function: should the resulting table be horizontally aligned at the center of the page?screenreg()
function). By default, two spaces are used. If the tables do not fit on a single page horizontally, the value can be set to 1
or 0
.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)
#Create a 'fake' Office document containing a regression table
table.string <- htmlreg(list(model.1, model.2), file="texreg.doc")
unlink("texreg.doc")
Run the code above in your browser using DataLab