latex.lme: Print LaTeX contrast table for lme, lm and glm models

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Generates a LaTex contrast table for the lme, glm and lm models, with number of significant digits shown depending on standard deviation of the contrasts. Signficant p-values can be shaded.

Usage

1
2
3
4
## S3 method for class 'lme'
latex(object, title = "", parameter = NULL, file = "",
  shadep = 0.05, caption = NULL, label = NULL, ctable = FALSE,
  form = NULL, interceptp = FALSE, moredec = 0, where = "!htbp", ...)

Arguments

object

result of a fit by lme, glm, lm, or of summary.lme. Note that there is are no variants for summary.lm and summary.glm.

title

printed in top left corner

parameter

label of the estimated parameter, used for caption and label of the table. Can have spaces. Defaults to target variable in formula. See also lmeLabel

file

output file name; default prints output to the standard output, which is the method of choice for Sweave.

shadep

table cells for p-values lower than this will be shaded; p-values for (Intercept) are never shaded.

caption

caption used for table; default caption is ANOVA for <parameter>

label

label used for table; default label is composed from model formula by lmeLabel

ctable

uses ctable-formatting of LaTeX by default.

form

Optional formula for caption display. By default, object model formula is used

interceptp

If TRUE, show p-value and t-value of intercept. Default is FALSE, because in most cases this value should not be interpreted.

moredec

Show more decimals than by default. Fractional values, e.g. 0.5 can be used here such that boundary case are rounded up instead of down

where

positioning parameter for LaTeX

...

Additional parameters passed to latex in Hmisc.

Value

Returns the result of the call to latex in Hmisc.

Note

Requires ctable, colortable in your Snw/tex file.

Author(s)

Dieter Menne, dieter.menne@menne-biomed.de

See Also

latex, latex.lme, lme

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Pinheiro/Bates page 47
library(nlme)
library(Hmisc)
fm1Oats <- lme(yield~ordered(nitro)*Variety, data=Oats,
  random = ~1|Block/Variety)
# Both versions give same result, output to console
latex(fm1Oats,"Yield")
latex(summary(fm1Oats),"Yield")
# The following model is nonsense, but it shows how default latex labels
# and captions are constructed in complex cases
fm2Oats <- lme(yield~I(sqrt(nitro))*Variety + I(nitro^2), data=Oats,
  random = ~1|Block/Variety)
latex(fm2Oats,"Yield with dumb model")

# For lm
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)
sex <- as.factor(rep(c("f","m"),10))
group <- gl(2,10,20, labels=c("Ctl","Trt"))
weight <- c(ctl, trt)
x <- lm(weight ~ group*sex)
latex(x,parameter="Weight",moredec=0.5)

# For glm
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)
d.AD <- data.frame(treatment, outcome, counts)
glm.D <- glm(counts ~ outcome + treatment, family=poisson())
latex(glm.D,parameter="severe")

dmenne/dlatex documentation built on May 15, 2019, 9:32 a.m.