numeric vector of probabilities specifying the quantiles.
All values of p must be between 0 and
1. The default value is p=0.5.
lcl.rank, n.plus.one.minus.ucl.rank
numeric vectors of non-negative integers indicating the ranks of the
order statistics that are used for the lower and upper bounds of the
confidence interval for the specified quantile(s). When lcl.rank=1
that means use the smallest value as the lower bound, when lcl.rank=2
that means use the second to smallest value as the lower bound, etc.
When n.plus.one.minus.ucl.rank=1 that means use the largest value
as the upper bound, when n.plus.one.minus.ucl.rank=2 that means use
the second to largest value as the upper bound, etc.
A value of 0 for lcl.rank indicates no lower bound
(i.e., -Inf) and a value of
0 for n.plus.one.minus.ucl.rank indicates no upper bound
(i.e., Inf). When ci.type="upper" then lcl.rank is set to 0 by default,
otherwise it is set to 1 by default.
When ci.type="lower" then n.plus.one.minus.ucl.rank is set
to 0 by default, otherwise it is set to 1 by default.
ci.type
character string indicating what kind of confidence interval to compute. The
possible values are "two-sided" (the default), "lower", and
"upper".
conf.level
numeric vector of numbers between 0 and 1 indicating the confidence level
associated with the confidence interval(s). The default value is
conf=0.95.
Details
If the arguments p, lcl.rank,
n.plus.one.minus.ucl.rank and conf.level are not all the
same length, they are replicated to be the
same length as the length of the longest argument.
The help file for eqnpar explains how nonparametric confidence
intervals for quantiles are constructed and how the confidence level
associated with the confidence interval is computed based on specified values
for the sample size and the ranks of the order statistics used for
the bounds of the confidence interval.
The function ciNparN determines the required the sample size via
a nonlinear optimization.
# Look at how the required sample size for a confidence interval
# increases with increasing confidence level for a fixed quantile:
seq(0.5, 0.9, by = 0.1)
#[1] 0.5 0.6 0.7 0.8 0.9
ciNparN(p = 0.9, conf.level=seq(0.5, 0.9, by = 0.1))
#[1] 7 9 12 16 22
#----------
# Look at how the required sample size for a confidence interval increases
# as the quantile moves away from 0.5:
ciNparN(p = seq(0.5, 0.9, by = 0.1))
#[1] 6 7 9 14 29
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(EnvStats)
Attaching package: 'EnvStats'
The following objects are masked from 'package:stats':
predict, predict.lm
The following object is masked from 'package:base':
print.default
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/EnvStats/ciNparN.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ciNparN
> ### Title: Sample Size for Nonparametric Confidence Interval for a Quantile
> ### Aliases: ciNparN
> ### Keywords: distribution design htest
>
> ### ** Examples
>
> # Look at how the required sample size for a confidence interval
> # increases with increasing confidence level for a fixed quantile:
>
> seq(0.5, 0.9, by = 0.1)
[1] 0.5 0.6 0.7 0.8 0.9
> #[1] 0.5 0.6 0.7 0.8 0.9
>
> ciNparN(p = 0.9, conf.level=seq(0.5, 0.9, by = 0.1))
[1] 7 9 12 16 22
> #[1] 7 9 12 16 22
>
> #----------
>
> # Look at how the required sample size for a confidence interval increases
> # as the quantile moves away from 0.5:
>
> ciNparN(p = seq(0.5, 0.9, by = 0.1))
[1] 6 7 9 14 29
> #[1] 6 7 9 14 29
>
>
>
>
>
> dev.off()
null device
1
>