This function will combine rm_uvsum and rm_mvsum outputs into a single table. The tableOnly argument must be set to TRUE when tables to be combined are created. The resulting table will be in the same order as the uvsum table and will contain the same columns as the uvsum and mvsum tables, but the p-values will be combined into a single column. There must be a variable overlapping between the uvsum and mvsum tables and all variables in the mvsum table must also appear in the uvsum table.

rm_uv_mv(
  uvsumTable,
  mvsumTable,
  covTitle = "",
  vif = FALSE,
  showN = FALSE,
  showEvent = FALSE,
  caption = NULL,
  tableOnly = FALSE,
  chunk_label,
  fontsize
)

Arguments

uvsumTable

Output from rm_uvsum, with tableOnly=TRUE

mvsumTable

Output from rm_mvsum, with tableOnly=TRUE

covTitle

character with the names of the covariate (predictor) column. The default is to leave this empty for output or, for table only output to use the column name 'Covariate'.

vif

boolean indicating if the variance inflation factor should be shown if present in the mvsumTable. Default is FALSE.

showN

boolean indicating if sample sizes should be displayed.

showEvent

boolean indicating if number of events (dichotomous outcomes) should be displayed.

caption

table caption

tableOnly

boolean indicating if unformatted table should be returned

chunk_label

only used if output is to Word to allow cross-referencing

fontsize

PDF/HTML output only, manually set the table fontsize

Value

A character vector of the table source code, unless tableOnly=TRUE in which case a data frame is returned

See also

Examples

require(survival)
data("pembrolizumab")
uvTab <- rm_uvsum(response = c('os_time','os_status'),
covs=c('age','sex','baseline_ctdna','l_size','change_ctdna_group'),
data=pembrolizumab,tableOnly=TRUE)
mv_surv_fit <- coxph(Surv(os_time,os_status)~age+sex+
baseline_ctdna+l_size+change_ctdna_group, data=pembrolizumab)
uvTab <- rm_mvsum(mv_surv_fit)

#linear model
uvtab<-rm_uvsum(response = 'baseline_ctdna',
covs=c('age','sex','l_size','pdl1','tmb'),
data=pembrolizumab,tableOnly=TRUE)
lm_fit=lm(baseline_ctdna~age+sex+l_size+tmb,data=pembrolizumab)
mvtab<-rm_mvsum(lm_fit,tableOnly = TRUE)
rm_uv_mv(uvtab,mvtab,tableOnly=TRUE)
#>                        Covariate Unadjusted Estimate(95%CI)    p
#> 1             Age at study entry       0.82 (-10.13, 11.76) 0.88
#> 5                    Patient Sex                       <NA> <NA>
#> 3                         Female                  Reference <NA>
#> 4                           Male    56.61 (-228.71, 341.93) 0.69
#> 6 Target lesion size at baseline         1.21 (-1.12, 3.54) 0.31
#> 2                  PD L1 percent        -3.50 (-8.27, 1.27) 0.15
#> 7                     log of TMB    18.78 (-125.18, 162.74) 0.80
#>   Adjusted Estimate(95%CI) p (adj)
#> 1     1.11 (-10.19, 12.42)    0.85
#> 5                     <NA>    <NA>
#> 3                Reference    <NA>
#> 4  32.22 (-260.52, 324.95)    0.83
#> 6       1.27 (-1.16, 3.70)    0.30
#> 2                     <NA>    <NA>
#> 7  27.63 (-121.07, 176.33)    0.71

#logistic model
uvtab<-rm_uvsum(response = 'os_status',
covs=c('age','sex','l_size','pdl1','tmb'),
data=pembrolizumab,family = binomial,tableOnly=TRUE)
logis_fit<-glm(os_status~age+sex+l_size+pdl1+tmb,data = pembrolizumab,family = 'binomial')
mvtab<-rm_mvsum(logis_fit,tableOnly = TRUE)
rm_uv_mv(uvtab,mvtab,tableOnly=TRUE)
#>                        Covariate Unadjusted OR(95%CI)     p Adjusted OR(95%CI)
#> 1             Age at study entry    0.98 (0.94, 1.01)  0.19  0.97 (0.93, 1.01)
#> 5                    Patient Sex                 <NA>  <NA>               <NA>
#> 3                         Female            Reference  <NA>          Reference
#> 4                           Male    1.11 (0.46, 2.77)  0.82  1.16 (0.44, 3.20)
#> 6 Target lesion size at baseline    1.00 (1.00, 1.01)  0.37  1.00 (0.99, 1.01)
#> 2                  PD L1 percent    0.98 (0.96, 1.00) 0.013  0.98 (0.96, 1.00)
#> 7                     log of TMB    0.70 (0.44, 1.10)  0.13  0.76 (0.47, 1.22)
#>   p (adj)
#> 1    0.14
#> 5    <NA>
#> 3    <NA>
#> 4    0.77
#> 6    0.97
#> 2   0.014
#> 7    0.25