plot.gComp: Plot estimates of difference and ratio effects obtained in...

View source: R/plot.gComp.R

plot.gCompR Documentation

Plot estimates of difference and ratio effects obtained in the bootstrap computations of the g-computation

Description

Plot histograms and Q-Q plots for each the difference and ratio estimates

Usage

## S3 method for class 'gComp'
plot(x, ...)

Arguments

x

(Required) An object of class gComp.

...

(Optional) additional arguments to be supplied to the 'geom_histogram call (e.g. to adjust binwidth for histogram, assign colors, etc.).

Value

a plot containing histograms and Q-Q plots of the difference and ratio estimates returned from R bootstrap iterations

Examples

## Obtain the risk difference and risk ratio for cardiovascular disease or death
## between patients with and without diabetes, while controlling for
## age,
## sex,
## BMI,
## whether the individual is currently a smoker, and
## if they have a history of hypertension.
data(cvdd)
set.seed(58)
diabetes.result <- gComp(data = cvdd, Y = "cvd_dth", X = "DIABETES",
Z = c("AGE", "SEX", "BMI", "CURSMOKE", "PREVHYP"), outcome.type = "binary", R = 60)
plot(diabetes.result)


riskCommunicator documentation built on June 1, 2022, 1:07 a.m.