outreg2: Arrange regression outputs into an illustrative table

View source: R/outreg2.R

outreg2R Documentation

Arrange regression outputs into an illustrative table

Description

Function to arrange regression outputs into an well-formatted LaTeX illustrative tables of multiple statistical models.

Usage

  outreg2(..., model.list, model.names = NULL,
    order = c("lr", "rl", "longest"), omitcoef = NULL,
    omit.model = NULL, coef.names = NULL,
    cons.below = TRUE, stars = "stata", lev = 0.05,
    additional.rows = NULL,
    title = first.word(deparse(substitute(object))),
    file = "", append = FALSE, label = title,
    rowlabel = "", rowlabel.just = "l", cgroup = NULL,
    n.cgroup = NULL, rgroup = NULL, n.rgroup = NULL,
    cgroupTexCmd = NULL, rgroupTexCmd = NULL,
    rownamesTexCmd = NULL, colnamesTexCmd = NULL,
    cellTexCmds = NULL, rowname,
    cgroup.just = rep("c", sum(n.cgroup)), colheads = NULL,
    extracolheads = NULL, extracolsize = "scriptsize",
    dcolumn = TRUE, tight = TRUE,
    numeric.dollar = !dcolumn, cdot = FALSE,
    longtable = FALSE, draft.longtable = TRUE,
    ctable = FALSE, booktabs = FALSE, table.env = TRUE,
    here = FALSE, lines.page = 40, caption = NULL,
    caption.lot = NULL, caption.loc = "bottom",
    double.slash = FALSE, vbar = FALSE,
    collabel.just = rep("c", nc), na.blank = TRUE,
    insert.bottom = NULL, do.begin = TRUE, do.end = TRUE,
    first.hline.double = !(booktabs | ctable),
    where = "!tbp", size = NULL,
    center = c("center", "centering", "none"),
    landscape = FALSE, multicol = TRUE,
    math.row.names = TRUE, math.col.names = FALSE,
    rowcolors = NULL, dec = 3)

Arguments

...

the statistical models.

model.list

the statistical models as a list. If model list is missing, then the models are assumed to be passed by ....

model.names

Optional vector of names to use as column headings in the table. If more models than names are supplied, unnamed models are numbered (starting at one more than the number of names).

order

Determines the order in which terms (rows) are included in the output when more than one model (column) is present. “lr” and “rl” take the order of terms from the first or last (leftmost or rightmost) model and appends new terms as they are encountered. “longest” uses the order of terms in the model with the most terms.Default = “lr”.

omitcoef

An optional integer or character vector of coefficient indices, or an expression involving coefnames that evaluates to integer or character, of rows to exclude from the output. See details.

omit.model

An optional integer or character vector of model indices (in the order they are entred) to be excluded from the output. Useful if order="largest", and the largest model is not to be shown. See details.

coef.names

An optional vector of names for coefficients. It is recommended to establish the omitcoef and order settings with automatic symbolic naming before supplying a vector of “pretty” variable names. If automatic symbolic naming is used, names are taken from the variables in the models and “sanitized” for latex. If coef.names are supplied, they must be valid latex, with double-backslash escape characters.

cons.below
stars

how statistical significance “stars”, either "stata", "default", or 1. "stata" is based on the stata default and gives three stars. "default" uses the R default, not to be confused with the function's (perhaps confusing) Default="stata"

lev

When stars=1, what level should be used for the test to reject statistical insignificance and bestow the glittering star? Disable decoration entirely by specifying lev=0. Default=.05.

additional.rows

A matrix with number of column equal to the number of included models for additional annotation of the table. Useful for fixed effects, country effects, etc. specifications.

title
file

name of the file to create. The default is not to create a file and to have the generated LaTeX code just printed to standard output. This is especially useful when running under Sweave in R using its results=tex tag, to save having to manage many small external files. When file="", latex keeps track of LaTeX styles that are called for by creating or modifying an object latexStyles (in .GlobalTemp in R or in frame 0 in S-Plus). latexStyles is a vector containing the base names of all the unique LaTeX styles called for so far in the current session. See the end of the examples section for a way to use this object to good effect. For dvips, file is the name of an output postscript file.

append

defaults to FALSE. Set to TRUE to append output to an existing file.

label

a text string representing a symbolic label for the table for referencing in the LaTeX \label and \ref commands. label is only used if caption is given.

rowlabel
rowlabel.just
cgroup
n.cgroup
rgroup
n.rgroup
cgroupTexCmd
rgroupTexCmd
rownamesTexCmd
colnamesTexCmd
cellTexCmds
rowname
cgroup.just
colheads
extracolheads
extracolsize
dcolumn
tight
numeric.dollar
cdot
longtable
draft.longtable
ctable
booktabs
table.env
here
lines.page
caption
caption.lot
caption.loc
double.slash
vbar
collabel.just
na.blank
insert.bottom
do.begin

Should the latex code at the beginning of table be printed? (Default: TRUE)

do.end

Should the latex code at the end of table be printed? (Default: TRUE)

first.hline.double
where
size
center
landscape
multicol
math.row.names
math.col.names
rowcolors

This command is useful for inserting color command. For instance, if rowcolors=rowcolors{1}{green}{pink}, then the rows are subsequently coloured in green and in pink.

Details

outreg2 borrows heavily from the apsrtable package. It preserves its flexibility in that many statistical models can be easily considered. It extends it by allowing finer control on the LaTeX output. This flexibility is obtained by using a modified version of the finction latex of the Hmisc package.

Value

A character vector containing the LaTeX table.

Author(s)

Giuseppe Ragusa


gragusa/grpack documentation built on July 6, 2023, 12:07 a.m.