coxph2table: Fit and pretty-print uni or multivariate Cox regressions

Description Usage Arguments Details Value Author(s)

Description

Fit and pretty-print uni or multivariate Cox regressions

Usage

1
2
3
4
5
  coxph2table(formula = NULL, data = NULL,
    output = c("latex", "data.frame", "text"),
    Format = c("journal", "simple"), rmNA = FALSE,
    Digits = 2, file = "", type = NULL, caption = NULL,
    label = NULL, ...)

Arguments

formula

formula object specifying the uni or multivariate model to be fitted.

data

a data frame containing the covariates

output

character string indicating the type of output. Possible values are \textlatex, data.frame and text. The default value is latex.

Format

character string indicating the type of format. Possible values are journal and simple. The first one is the default.

rmNA

logical, whehter rows corresponding to NA-categories should be removed. Default is FALSE.

Digits

integer, the number of floating point digits in the output. The default value is 2.

file

full path to the file where the text output should be saved. The default value is "", i.e. the standard output.

type

character string, indicates the type of model. Possible values are univariate and multivariate. Note this argument must always be set, since it decides the way the output will be presented.

caption

Character string (possibly multiline, glued together with paste). This is the caption that will appear in the LaTeX output.

label

character string representing the label used in LaTeX for referencing

...

optional arguments

Details

This function fits the uni or multivariate Cox regression specified in the formula and returns an output that is suitable for pubblication. The output can be in LaTeX, in text or a data frame for further manual modification. There are two formats available, one of which is closer to what is usually found in publications. If categorical covariates contain NAs as additional levels, the rmNA allows to remove the corresponding rows from the output. The number of digits can be set by the user, and the text output can be saved on a file (default is to print it to screen). Note; the user must specify whether the model is univariate or multivariate, since the formula can contain multiple covariates even in univariate models. In this case each covariate will be fit independently in a univariate model, but the results will be presented in the same table for all covariates.

Value

either some LaTeX code, a text output or file, or a data frame, depending on the value of the output parameter

Author(s)

Giovanni d'Ario


gdario/coxph2table documentation built on May 16, 2019, 11:14 p.m.