xtable.joint: Print an LaTeX-ready 'xtable' for a 'joint' object.

View source: R/fit2xtab.R

xtable.jointR Documentation

Print an LaTeX-ready xtable for a joint object.

Description

Prints an xtable output for a fitted joint object to the console, or to a specified save location

Usage

## S3 method for class 'joint'
xtable(
  x,
  caption = NULL,
  label = NULL,
  align = NULL,
  digits = NULL,
  display = NULL,
  auto = FALSE,
  p.val = FALSE,
  max.row = NULL,
  dp = 3,
  vcov = FALSE,
  capture = FALSE,
  capture.location = "",
  hlines = "middle-bottom",
  booktabs = TRUE,
  size = "footnotesize",
  ...
)

Arguments

x

a joint model fit by the joint function.

caption

character, specifies the caption argument of xtable. By default this takes value NULL, which results in a generic caption being generated.

label

character, specifies the label argument of xtable.

align

character, specifies the align argument of xtable. Note by default this is NULL, as alignment is done internally.

digits

integer, specifies the digits argument of xtable. Note by default this is NULL, as argument dp controls this (but can be specified through this, too).

display

character, specifies the display argument of xtable.

auto

logical, specifies the auto argument of xtable. Defaults to FALSE. Not recommended to change.

p.val

logical, should p-values be returned? Defaults to p.val = FALSE.

max.row

integer, the number of rows after which the table is ‘broken’ vertically and merged horizontally; useful for long tables. Defaults to max.row = NULL which results in one long table. Note that this can be quite finicky, so trial and error may be required.

dp

integer, the number of decimal places to round the estimate, standard error and confidence intervals to; defaults to dp = 3.

vcov

logical, should the half-vectorisation of the block diagonal of covariance matrix be reported? Default is vcov = FALSE.

capture

logical, should the printed xtable output be saved anywhere instead of just printed to the console? Defaults to capture = FALSE.

capture.location

character, if capture = TRUE, this should specify what file it should be saved in. Defaults to capture.location = "".

hlines

character, specifies which horizontal lines are used in the outputted LaTeX table. Supply a character string which contains "top", "middle" and/or "bottom" (in any order) to specify a toprule; midrule and bottomrule in the table. If booktabs = FALSE, then these will simply be hlines. For instance hlines = "top-middle-bottom" prints all three; whilst hlines = "middle-bottom" skips the toprule.

booktabs

logical, if booktabs = TRUE (the default) then toprule; midrule and bottomrule replace the usual hlines.

size

character, LaTeX size to be placed before the tabular environment, defaults to size = "footnotesize"; replace with "normalsize" if wanted.

...

additional arguments, none used.

Value

A LaTeX-ready xtable print-out of the joint model. A list containing constituent tables is also returned invisibly, along with the final xtable output.

Author(s)

James Murray (j.murray7@ncl.ac.uk).

See Also

joint

Examples

# Bivariate joint model ------------------------------------------------
require(xtable)
data <- simData(n = 100)$data
long.formula <- list(
  Y.1 ~ time + cont + bin + (1 + time|id),
  Y.2 ~ time + cont + bin + (1 + time|id)
)
surv.formula <- Surv(survtime, status) ~ cont + bin
family <- list("gaussian", "gaussian")
fit <- joint(long.formula, surv.formula, data, family)
xtable(fit)
# Example of arguments: add dummy caption, add p-values.
xtable(fit, p.val = TRUE, dp = 4, caption = "This is a caption")
# Change size, place horizontal lines everywhere
xtable(fit, size = "normalsize", hlines = c("top-middle-bottom"))
# Make a wider table without booktabs 
xtable(fit, booktabs = FALSE, max.row = 6)

gmvjoint documentation built on Oct. 6, 2024, 1:07 a.m.