Table2: Create journal style model output table.

Description Usage Arguments Details Value Examples

View source: R/Table2.R

Description

Create journal style model output table.

Usage

1
2
Table2(model, data, catcols = NULL, esdigits = 2, output = NULL,
  pdigits = 2, eps = 0.001)

Arguments

model

Object output from lm, glm or coxph

data

A dataframe including the exposure variable.

esdigits

Controlling the effect size digits. Default to 2.

output

String of path to store the output word file. For example, 'Table2.doc' or 'Table2.rtf'

pdigits

Controlling the significant p-value digits. Default to 2.

eps

P-value tolerane. Those less than eps are formatted as "< [eps]". Default to 0.001

catcol

A vector of factrozied categorical column names in character. Default to NULL.

Details

Table2 function

This function helps to create journal style "Table 2" (model output). Currently the function only supports lm, glm and coxph objects.
The output include effect size (95% CI) along with p-values.
The output will be saved in word file.

Value

If output is not specified, a dataframe will be returned. Otherwise, a rtf file will be saved in the specified path.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(mtcars)

log = glm(vs==1~mpg+am, family='binomial', data=mtcars)

  Variable     ES_CI              P_val
(Intercept)    0 (0, 0.03)        0.006
mpg            1.98 (1.2, 3.24)   0.007
am
  0            Ref                Ref
  1            0.05 (0, 1.14)     0.060

acmilannesta/JReport documentation built on Feb. 19, 2020, 4:24 a.m.