cicc_plot: Plotting Upper Bounds on Relative and Attributable Risk

Description Usage Arguments Value References Examples

View source: R/cicc_plot.R

Description

Plots upper bounds on relative and attributable risk

Usage

1
2
3
4
5
6
7
8
9
cicc_plot(
  results,
  parameter = "RR",
  sampling = "cc",
  save_plots = FALSE,
  file_name = Sys.Date(),
  plots_ctl = 0.3,
  plots_dir = FALSE
)

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)

plots_dir

a directory where the plots are saved (default = FALSE); plots will be saved under "(current working directory)/figures" by default.

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 in Case-Control Studies. https://arxiv.org/abs/2004.08318.

Examples

1
2
3
4
5
6
# 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. 29, 2020, 5:07 p.m.