plot.subgroupAnalysis: plot.subgroupAnalysis

Description Usage Arguments Details Author(s) See Also Examples

View source: R/plot.subgroupAnalysis.R

Description

This function operates on a "subgroupAnalysis" object to produce a formatted table and a forest plot

Usage

1
2
## S3 method for class 'subgroupAnalysis'
plot(x, ...)

Arguments

x

- a subgroupAnalysis object

...

- passed on to plotConfidence

Details

This function produces a formatted table of a subgroupAnalysis object and adds a forest plot. If further details needs attention before plotting is is advisable use adjust the table produced by the summary function and then plotting with the plotConfidence function

Author(s)

Christian Torp-Pedersen

See Also

subgroupAnalysis, plotConfidence

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#load libraries
library(Publish)
library(survival)
library(data.table)
data(traceR) #get dataframe traceR
setDT(traceR)
traceR[,':='(wmi2=factor(wallMotionIndex<0.9,levels=c(TRUE,FALSE), 
                labels=c("bad","good")),
             abd2=factor(abdominalCircumference<95, levels=c(TRUE,FALSE), 
                labels=c("slim","fat")),
             sex=factor(sex))]
fit_cox <- coxph(Surv(observationTime,dead)~treatment,data=traceR)
# Selected subgroups - univariable analysis
sub_cox <- subgroupAnalysis(fit_cox,traceR,treatment="treatment",
  subgroup=c("smoking","sex","wmi2","abd2")) # subgroups as character string
plot(sub_cox)  

Example output

Loading required package: prodlim

Publish documentation built on Jan. 8, 2021, 5:37 p.m.