Learn R Programming

qgcomp (version 2.15.2)

plot.qgcompfit: Default plotting method for a qgcompfit object

Description

Plot a quantile g-computation object. For qgcomp.glm.noboot, this function will create a butterfly plot of weights. For qgcomp.glm.boot, this function will create a box plot with smoothed line overlaying that represents a non-parametric fit of a model to the expected outcomes in the population at each quantile of the joint exposures (e.g. '1' represents 'at the first quantile for every exposure')

Usage

# S3 method for qgcompfit
plot(
  x,
  suppressprint = FALSE,
  pointwisebars = TRUE,
  modelfitline = TRUE,
  modelband = TRUE,
  flexfit = TRUE,
  pointwiseref = ceiling(x$q/2),
  ...
)

# S3 method for qgcompmultfit plot( x, suppressprint = FALSE, pointwisebars = TRUE, modelfitline = TRUE, modelband = TRUE, flexfit = TRUE, pointwiseref = ceiling(x$q/2), ... )

Arguments

x

"qgcompfit" object from qgcomp.glm.noboot, qgcomp.glm.boot, qgcomp.cox.noboot, qgcomp.cox.boot, qgcomp.zi.noboot or qgcomp.zi.boot functions

suppressprint

If TRUE, suppresses the plot, rather than printing it by default (it can be saved as a ggplot2 object (or list of ggplot2 objects if x is from a zero- inflated model) and used programmatically) (default = FALSE)

pointwisebars

(boot.gcomp only) If TRUE, adds 95% error bars for pointwise comparisons of E(Y|joint exposure) to the smooth regression line plot

modelfitline

(boot.gcomp only) If TRUE, adds fitted (MSM) regression line of E(Y|joint exposure) to the smooth regression line plot

modelband

If TRUE, adds 95% prediction bands for E(Y|joint exposure) (the MSM fit)

flexfit

(boot.gcomp only) if TRUE, adds flexible interpolation of predictions from underlying (conditional) model

pointwiseref

(boot.gcomp only) integer: which category of exposure (from 1 to q) should serve as the referent category for pointwise comparisons? (default=1)

...

unused

Functions

  • plot(qgcompmultfit): Plot method for qgcomp multinomial fits

See Also

qgcomp.glm.noboot, qgcomp.glm.boot, and qgcomp