Horizontal forest plot of point estimate with confidence intervals. Includes dichotomous or olr, depending on number of levels in "x".
Title and axis labels can be added to the ggplot afterwards.
Usage
ci_plot(ds, x, y, vars, dec = 3, lbls = NULL, title = NULL)
Arguments
- ds
data set
- x
text string of main exposure variable
- y
text string of outcome variable
- vars
variables for multivariate analysis.
- dec
Decimals in labels
- lbls
Labels for variable names
- title
Plot title. Can be specified later.
Examples
data(talos)
talos[,"mrs_1"]<-factor(talos[,"mrs_1"],ordered=TRUE)
talos$bin <- factor(sample(1:2, size = nrow(talos), replace = TRUE))
ci_plot(ds = talos, x = "rtreat", y = "mrs_1", vars = c("hypertension","diabetes"))
#> Waiting for profiling to be done...