Confidence curves are a way to show the confidence in an estimate computed from sample data. They are useful because they show all confidence levels simultaneously, thereby giving a good sense of the accuracy of the estimate, without forcing the researchers to make a more or less arbitrary choice for one confidence level.
ggConfidenceCurve(metric = "d",
value = NULL,
n = NULL,
conf.level = NULL,
wRange = c(0.05, 0.8),
curveSize = 1,
curveColor = "black",
confRange = c(1e-04, 0.9999),
confLines = c(0.5, 0.8, 0.95, 0.99),
confLineColor = "grey",
confLineSize = 1,
xlab = metric,
steps = 1000,
theme = theme_bw())
The metric, currently only 'd' (Cohen's d) and 'r' (Pearson's r) are implemented.
The value for which to create the confidence curve plot.
The sample size for which to create the confidence curve plot. If n
is specified, the y axis shows confidence levels (i.e. a conventional confidence curve is generated). If n
is set to NULL
, the y axis shows sample sizes. Either n
or conf.level
must be NULL
.
The confidence level for which to create the confidence curve plot. If conf.level
is specified, the y axis shows sample sizes. If conf.level
is set to NULL
, the y axis shows confidence levels (i.e. a conventional confidence curve is generated). Either n
or conf.level
must be NULL
.
The range of 'half-widths', or margins of error, to plot in the confidence curve plot if no sample size is specified (if n=NULL
).
The line size of the confidence curve line.
The color of the confidence curve line.
The range of confidence levels to plot.
If a traditional confidence curve is generated, lines can be added to indicate the metric values corresponding to the lower and upper confidence interval bounds.
If confidence lines are added (see confLines
), this is the color in which they are drawn.
If confidence lines are added (see confLines
), this is the size in which they are drawn.
The label on the x axis.
The number of steps to use when generating the data for the confidence curves' more steps yield prettier, smoother curves, but take more time.
The ggplot
theme to use.
A ggplot2
plot.
Bender, R., Berg, G., & Zeeb, H. (2005). Tutorial: Using confidence curves in medical research. Biometrical Journal, 47(2), 237-247. http://doi.org/10.1002/bimj.200410104
Birnbaum, A. (1961). Confidence curves: An omnibus technique for estimation and testing statistical hypotheses. Journal of the American Statistical Association, 56(294), 246-249. http://doi.org/10.1080/01621459.1961.10482107
# NOT RUN {
ggConfidenceCurve(metric='d', value = .5, n = 128);
ggConfidenceCurve(metric='d', value = .5, conf.level = .95);
# }
Run the code above in your browser using DataLab