plot.subtee: Plotting subgroup treatment effect estimates

View source: R/generic-funcs-subtee.R

plot.subteeR Documentation

Plotting subgroup treatment effect estimates

Description

Plotting function for objects of class 'subtee'. Visualizes estimates and confidence intervals for all candidate subgroups (and complements) in a forest plot.

Usage

## S3 method for class 'subtee'
plot(x, y = NULL, z = NULL, 
     type = c("trtEff", "trtEffDiff"),
     show.compl = FALSE,
     xlab = "default", ylab = "default", main = "default",
     them,
     point.size = 2.5, line.size = 1,
     palette = "default", ...)

Arguments

x

An object of class subtee, usually a result of a call to modav, unadj or bagged.

y

An object of class subtee, usually a result of a call to modav, unadj or bagged. If this is used, a comparison between the estimates will be provided.

z

An object of class subtee, usually a result of a call to modav, unadj or bagged. If this is used, a comparison between the estimates will be provided.

type

A character specifyng if treatment effects should be plotted ("trtEff") or the treatment-subgroup interactions. ("trtEffDiff")

show.compl

Logical. If true estimates for candidate subgroup complements should be plotted as well. Only available if type = "trtEff".

xlab

Character. Label for x-axis.

ylab

Character. Label for y-axis.

main

Character. Title. The default is to provide a string with the level of the uncertainty intervals.

them

ggplot2 theme. Use theme() if you just need to tweak the display, or provide a complete ggplot2 theme (e.g theme_bw()).

point.size

Size for points, which denote point estimates of treatment effects. Default to 2.5.

line.size

Size for points, which denote confidence interval of treatment effects. Default to 1.

palette

A string providing a ggplot2 colour palette to use. This will be passed to the palette option in a scale_colour_brewer sentence.

...

Not used.

Value

Forest plot visualizing treatment effect estimates (if type = "trtEff") or treatment-subgroup interactions in candidate subgroups (if type = "trtEffDiff").

References

Ballarini, N. Thomas, M., Rosenkranz, K. and Bornkamp, B. (2021) "subtee: An R Package for Subgroup Treatment Effect Estimation in Clinical Trials" Journal of Statistical Software, 99, 14, 1-17, doi: 10.18637/jss.v099.i14

See Also

summary.subtee

Examples

data(datnorm)
cand.groups <- subbuild(datnorm, height, labvalue, region, smoker)
fitd <- cbind(datnorm, cand.groups)
subgr <- colnames(cand.groups)
### Plot unadjusted estimates
res_unadj <- unadj(resp = "y", trt = "treat", subgr = subgr, data = fitd, 
             covars = ~ x1 + x2, fitfunc = "lm")
summary(res_unadj)
plot(res_unadj)
plot(res_unadj, show.compl = TRUE)
plot(res_unadj, type = "trtEffDiff")

### Compare unadjusted with model averaging estimates
res_modav <- modav(resp = "y", trt = "treat", subgr = subgr, data = fitd, 
             covars = ~ x1 + x2, fitfunc = "lm")
plot(res_unadj, res_modav, show.compl = TRUE)
plot(res_unadj, res_modav, type = "trtEffDiff")

subtee documentation built on March 22, 2022, 5:07 p.m.