cicc_plot: Plotting Upper Bounds on Relative and Attributable Risk

View source: R/cicc_plot.R

cicc_plotR Documentation

Plotting Upper Bounds on Relative and Attributable Risk

Description

Plots upper bounds on relative and attributable risk

Usage

cicc_plot(
  results,
  parameter = "RR",
  sampling = "cc",
  save_plots = FALSE,
  file_name = Sys.Date(),
  plots_ctl = 0.3
)

Arguments

results

estimation results from either cicc_RR or cicc_AR

parameter

'RR' for relative risk; 'AR' for attributable risk (default = 'RR')

sampling

'cc' for case-control sampling; 'cp' for case-population sampling (default = 'cc')

save_plots

TRUE if the plots are saved as pdf files; FALSE if not (default = FALSE)

file_name

the pdf file name to save the plots (default = Sys.Date())

plots_ctl

value to determine the topleft position of the legend in the figure a large value makes the legend far away from the confidence intervals (default = 0.3)

Value

A X-Y plot where the X axis shows the range of p from 0 to p_upper and the Y axis depicts both point estimates and the upper end point of the one-sided confidence intervals.

References

Jun, S.J. and Lee, S. (2020). Causal Inference under Outcome-Based Sampling with Monotonicity Assumptions. https://arxiv.org/abs/2004.08318.

Examples

# use the ACS_CC dataset included in the package.
  y = ciccr::ACS_CC$topincome
  t = ciccr::ACS_CC$baplus
  x = ciccr::ACS_CC$age
  results = cicc_RR(y, t, x)
  cicc_plot(results)


ciccr documentation built on Oct. 21, 2023, 1:08 a.m.