
Last chance! 50% off unlimited learning
Sale ends in
xtable
package (Dahl 2014).## S3 method for class 'aictab':
xtable(x, caption = NULL, label = NULL, align = NULL,
digits = NULL, display = NULL, nice.names = TRUE,
include.AICc = TRUE, include.LL = TRUE, include.Cum.Wt = FALSE,
\dots)## S3 method for class 'boot.wt':
xtable(x, caption = NULL, label = NULL, align = NULL,
digits = NULL, display = NULL, nice.names = TRUE,
include.AICc = TRUE, include.AICcWt = FALSE, \dots)
## S3 method for class 'dictab':
xtable(x, caption = NULL, label = NULL, align = NULL,
digits = NULL, display = NULL, nice.names = TRUE,
include.DIC = TRUE, include.Cum.Wt = FALSE, \dots)
## S3 method for class 'mb.chisq':
xtable(x, caption = NULL, label = NULL, align = NULL,
digits = NULL, display = NULL, nice.names = TRUE,
include.detection.histories = TRUE, \dots)
## S3 method for class 'modavg':
xtable(x, caption = NULL, label = NULL, align = NULL,
digits = NULL, display = NULL, nice.names = TRUE,
print.table = FALSE, \dots)
## S3 method for class 'modavgEffect':
xtable(x, caption = NULL, label = NULL,
align = NULL, digits = NULL, display = NULL, nice.names = TRUE,
print.table = FALSE, \dots)
## S3 method for class 'modavgPred':
xtable(x, caption = NULL, label = NULL,
align = NULL, digits = NULL, display = NULL, nice.names = TRUE,
\dots)
## S3 method for class 'modavgShrink':
xtable(x, caption = NULL, label = NULL,
align = NULL, digits = NULL, display = NULL, nice.names = TRUE,
print.table = FALSE, \dots)
## S3 method for class 'multComp':
xtable(x, caption = NULL, label = NULL,
align = NULL, digits = NULL, display = NULL, nice.names = TRUE,
print.table = FALSE, \dots)
aictab
, boot.wt
, dictab
,
mb.chisq
, modavg
, modavgEffect
,
modavgPred
, modavgShrink
, or multComp
resulting
fNULL
and suppressNULL
and suppresses the label.s
for strings, f
for numbers in the
regular format, or d
for inTRUE
, column labels are modified to improve their
appearance in the table. If FALSE
, simpler labels are used,
or the ones supplied directly by the user in the object storing the
output.TRUE
, the column containing
the information criterion of each model is printed in the table.
If FALSE
, the column is suppressed.TRUE
, the column containing
the deviance information criterion (DIC) of each model is printed in
the table. If FALSE
, the column is suppressed.TRUE
, the column containing the
log-likelihood of each model is printed in the table. If
FALSE
, the column is suppressed.TRUE
, the column containing
the cumulative Akaike weights is printed in the table. If
FALSE
, the column is suppressed.TRUE
, the column containing
the Akaike weight of each model is printed in the table. If
FALSE
, the column is suppressed.TRUE
, the
column containing detection histories is printed in the table. If
FALSE
, the column is suppressed.TRUE
, the model selection table
is printed and other sections of the output are suppressed (e.g.,
model-averaged estimates). If FALSE
, the model selection
table is suppressed and only the other portion oxtable
creates an object of the xtable
class inheriting
from the data.frame
class. This object can then be used with
print.xtable
for added flexibility such as suppressing row names,
modifying caption placement, and format tables in LaTeX or HTML
format.aictab
, boot.wt
, dictab
,
formatC
, mb.chisq
, modavg
,
modavgEffect
, modavgPred
,
modavgShrink
, multComp
,
xtable
, print.xtable
if(require(xtable)) {
##model selection
data(dry.frog)
##setup candidate models
Cand.models <- list( )
Cand.models[[1]] <- lm(log_Mass_lost ~ Shade + Substrate +
cent_Initial_mass + Initial_mass2,
data = dry.frog)
Cand.models[[2]] <- lm(log_Mass_lost ~ Shade + Substrate +
cent_Initial_mass + Initial_mass2 +
Shade:Substrate, data = dry.frog)
Cand.models[[3]] <- lm(log_Mass_lost ~ cent_Initial_mass +
Initial_mass2, data = dry.frog)
Model.names <- c("additive", "interaction", "no shade")
##model selection table
out <- aictab(cand.set = Cand.models, modnames = Model.names)
xtable(out)
##exclude AICc and LL
xtable(out, include.AICc = FALSE, include.LL = FALSE)
##remove row names and add caption
print(xtable(out, caption = "Model selection based on AICc"),
include.rownames = FALSE, caption.placement = "top")
##model-averaged estimate of Initial_mass2
mavg.mass <- modavg(cand.set = Cand.models, parm = "Initial_mass2",
modnames = Model.names)
#model-averaged estimate
xtable(mavg.mass, print.table = FALSE)
#table with contribution of each model
xtable(mavg.mass, print.table = TRUE)
##model-averaged predictions for first 10 observations
preds <- modavgPred(cand.set = Cand.models, modnames = Model.names,
newdata = dry.frog[1:10, ])
xtable(preds)
}
Run the code above in your browser using DataLab