plot.PRISM {StratifiedMedicine}R Documentation

plot.PRISM

Description

Plots PRISM results. Options include "tree", "forest", "resample", and "PLE:waterfall".

Usage

## S3 method for class 'PRISM'
plot(
  x,
  type = "tree",
  target = NULL,
  grid.data = NULL,
  grid.thres = ">0",
  prob.thres = NULL,
  tree.plots = "outcome",
  nudge_out = 0.1,
  width_out = 0.5,
  nudge_dens = ifelse(tree.plots == "both", 0.3, 0.1),
  width_dens = 0.5,
  ...
)

Arguments

x

PRISM object

type

Type of plot (default="tree", ggparty based plot with parameter estimates, along with options for including outcome or probability based plots). Other options include "forest" (forest plot for overall and subgroups),"PLE:waterfall" (waterfall plot of PLEs), "PLE:density" (density plot of PLEs), "resample" (resampling distribution of parameter estimates for overall and subgroups), and "heatmap" (heatmap of ple estimates/probabilities). For "tree" and "forest", CIs are based on the observed data unless resampling is used. For bootstrap resampling, if calibrate=TRUE, then calibrated CIs along are shown, otherse CIs based on the percentile method are shown.

target

For "resample" plot only, must be specify which estimand to visualize. Default=NULL.

grid.data

Input grid of values for 2-3 covariates (if 3, last variable cannot be continuous). This is required for type="heatmap". Default=NULL.

grid.thres

Threshold for PLE, ex: I(PLE>thres). Used to estimate P(PLE>thres) for type="heatmap". Default is ">0". Direction can be reversed and can include equality sign (ex: "<=").

prob.thres

Probability threshold, ex: P(Mean(A=1 vs A=0)>c. Default=NULL, which defaults to using ">0", unless param="cox", which "P(HR(A=1 vs A=0))<1". If a density plot is included, setting prob.thres=">c" will use green colors for values above c, and red colors for values below c. If prob.thres="<c", the reverse color scheme is used.

tree.plots

Type of plots to include in each node of the "tree" plot. Default="outcome". For non-survival data, if the fitted PRISM object (x) does not include patient-level estimates (ple="None"), or if param="lm", this will plot the observed outcomes (Y) by the treatment assignment (A). If the fitted PRISM object includes patient-level estimates (ex: ple="ranger"), this includes box-plots of the model-based (if param="ple") or double-robust based (if param="dr") counter-factual estimates of E(Y|X,A=a) for continuous outcomes or Prob(Y=1|X,A=a) for binary outcomes (truncated to 0,1). For survival data, Kaplan-Meier based survival estimates are plotted by treatment group. For "density", the estimated probability density of the treatment effects is shown (normal approximation, unless resampling is used). "both" include the "outcome" and "density" plots. If tree.plots = "none", then only the tree structure is shown.

nudge_out

Nudge tree outcome plot (see ggparty for details)

width_out

Width of tree outcome plot (see ggparty for details)

nudge_dens

Nudge tree density plot

width_dens

Width of density tree outcome plot

...

Additional arguments (currently ignored).

Value

Plot (ggplot2) object

See Also

PRISM


[Package StratifiedMedicine version 1.0.5 Index]