plotCiNparDesign(x.var = "n", y.var = "conf.level", range.x.var = NULL,
n = 25, p = 0.5, conf.level = 0.95, ci.type = "two.sided",
lcl.rank = ifelse(ci.type == "upper", 0, 1),
n.plus.one.minus.ucl.rank = ifelse(ci.type == "lower", 0, 1),
plot.it = TRUE, add = FALSE, n.points = 100, plot.col = "black",
plot.lwd = 3 * par("cex"), plot.lty = 1, digits = .Options$digits,
cex.main = par("cex"), ..., main = NULL, xlab = NULL, ylab = NULL,
type = "l")
"n"
(sample size; the default),
"p"
(quantile), and "conf.level"
(the confidence level).conf.level
(confidence level; the default), and
"n"
(sample size).x.var
.
When x.var="n"
the default value is c(2,50)
. When
x.var="p"
n=25
.
Missing (NA
), undefined (NaN
), and infinite (Inf
, -Inf
) values are not allowed.
This argument is ignored p=0.5
. The argument is
ignored if x.var="p"
.conf.level=0.95
. This argument is ignored if
x.var="conf.level"
or y.var="conf.level"
."two-sided"
(the default), "lower"
, and
"upper"
.lcl.rank=1
that means use the smalladd
) on the current graphics device. If
plot.it=FALSE
, no plot is produced, but a list of (x,y) values
is returned (see VALUE). Tadd=TRUE
), or to create a plot from scratch
(add=FALSE
). The default value is add=FALSE
.
This argument is ignored if n.points
x-values evenly spaced between
range.x.var[1]
and range.x.var[2]
. The default value is
n.points=100<
plot.col="black"
. See the
entry for col
in the help file for par
3*par("cex")
. See the entry for lwd
in the help file for par
for more information.plot.lty=1
. See the entry for lty
in the help file for par
for more information.options("digits")
.par
).plotCiNparDesign
invisibly returns a list with components
x.var
and y.var
, giving coordinates of the points that
have been or would have been plotted.eqnpar
, ciNparConfLevel
,
and ciNparN
for information on how to compute a
nonparametric confidence interval for a quantile, how the confidence level
is computed when other quantities are fixed, and how the sample size is
computed when other quantities are fixed.eqnpar
.eqnpar
, ciNparConfLevel
,
ciNparN
.# Look at the relationship between confidence level and sample size for
# a two-sided nonparametric confidence interval for the 90'th percentile.
dev.new()
plotCiNparDesign(p = 0.9)
#----------
# Plot sample size vs. quantile for various levels of confidence:
dev.new()
plotCiNparDesign(x.var = "p", y.var = "n", range.x.var = c(0.8, 0.95),
ylim = c(0, 60), main = "")
plotCiNparDesign(x.var = "p", y.var = "n", conf.level = 0.9, add = TRUE,
plot.col = 2, plot.lty = 2)
plotCiNparDesign(x.var = "p", y.var = "n", conf.level = 0.8, add = TRUE,
plot.col = 3, plot.lty = 3)
legend("topleft", c("95%", "90%", "80%"), lty = 1:3, col = 1:3,
lwd = 3 * par('cex'), bty = 'n')
title(main = paste("Sample Size vs. Quantile for ",
"Nonparametric CI for
Quantile, with ",
"Various Confidence Levels", sep=""))
#==========
# Clean up
#---------
graphics.off()
Run the code above in your browser using DataLab