Title: | Admissible Exact Intervals for One-Dimensional Discrete Distributions |
---|---|
Description: | Construct the admissible exact intervals for the binomial proportion, the Poisson mean and the total number of subjects with a certain attribute or the total number of the subjects for the hypergeometric distribution. Both one-sided and two-sided intervals are of interest. This package can be used to calculate the intervals constructed methods developed by Wang (2014) <doi:10.5705/ss.2012.257> and Wang (2015) <doi:10.1111/biom.12360>. |
Authors: | Chongxiu Yu [aut, cre], Weizhen Wang [aut], Zhongzhan Zhang [aut] |
Maintainer: | Chongxiu Yu <[email protected]> |
License: | AGPL (>= 3) |
Version: | 1.0.5 |
Built: | 2024-12-03 07:00:12 UTC |
Source: | CRAN |
An admissible exact confidence interval of level 1-alpha is constructed for the binomial proportion p. This function can be used to calculate the interval constructed method proposed by Wang (2014).
WbinoCI(x, n, conf.level = 0.95, details = FALSE)
WbinoCI(x, n, conf.level = 0.95, details = FALSE)
x |
the number of success or the observed data. |
n |
the sample size. |
conf.level |
Confidence level. The default is 0.95. |
details |
TRUE/FALSE, can be abbreviated. To choose whether to compute the confidence interval for the whole sample points and output the infimum coverage probability. The default is FALSE. |
Suppose X~bino(n,p), the sample space of X is {0,1,...,n}. Wang (2014) proposed an admissible interval which is obtained by uniformly shrinking the initial 1-alpha Clopper-Pearson interval from the middle to both sides of the sample space iteratively. This interval is admissible so that any proper sub-interval of it cannot assure the confidence coefficient. This means the interval cannot be shortened anymore.
A list which contains the confidence interval (CI) of the sample point and the confidence intervals (CIM) for all the points and the icp.
Clopper, C. J. and Pearson, E. S. (1934). The use of confidence or fiducial limits in the case of the binomial. "Biometrika" 26: 404-413.
Wang, W. (2014). An iterative construction of confidence intervals for a proportion. "Statistica Sinica" 24: 1389-1410.
WbinoCI(x=2,n=5,conf.level=0.95,details=TRUE) WbinoCI(x=2,n=5,conf.level=0.95)
WbinoCI(x=2,n=5,conf.level=0.95,details=TRUE) WbinoCI(x=2,n=5,conf.level=0.95)
The 1-alpha Clopper-Pearson lower interval for the binomial proportion p.
WbinoCI_lower(x, n, conf.level = 0.95, details = FALSE)
WbinoCI_lower(x, n, conf.level = 0.95, details = FALSE)
x |
the number of success or the observed data. |
n |
the sample size. |
conf.level |
Confidence level. The default is 0.95. |
details |
TRUE/FALSE, can be abbreviated. To choose whether to compute the confidence interval for the whole sample points. The default is FALSE. |
A list which contains the confidence interval (CI) of the sample point and the confidence intervals (CIM) for all the points.
Clopper, C. J. and Pearson, E. S. (1934). The use of confidence or fiducial limits in the case of the binomial. "Biometrika" 26: 404-413.
WbinoCI_lower(x=2,n=5,conf.level=0.95,details=TRUE) WbinoCI_lower(x=2,n=5,conf.level=0.95)
WbinoCI_lower(x=2,n=5,conf.level=0.95,details=TRUE) WbinoCI_lower(x=2,n=5,conf.level=0.95)
The 1-alpha Clopper-Pearson upper interval for the binomial proportion p.
WbinoCI_upper(x, n, conf.level = 0.95, details = FALSE)
WbinoCI_upper(x, n, conf.level = 0.95, details = FALSE)
x |
the number of success or the observed data. |
n |
the sample size. |
conf.level |
Confidence level. The default is 0.95. |
details |
TRUE/FALSE, can be abbreviated. To choose whether to compute the confidence interval for the whole sample points. The default is FALSE. |
A list which contains the confidence interval (CI) of the sample point and the confidence intervals (CIM) for all the points.
Clopper, C. J. and Pearson, E. S. (1934). The use of confidence or fiducial limits in the case of the binomial. "Biometrika" 26: 404-413.
WbinoCI_upper(x=2,n=5,conf.level=0.95,details=TRUE) WbinoCI_upper(x=2,n=5,conf.level=0.95)
WbinoCI_upper(x=2,n=5,conf.level=0.95,details=TRUE) WbinoCI_upper(x=2,n=5,conf.level=0.95)
The confidence interval for the number of white balls in an urn that contains M white balls and N-M black balls when sampling without replacement. This function can be used to calculate the interval constructed method proposed by Wang (2015).
WhyperCI_M(x, n, N, conf.level, details = FALSE)
WhyperCI_M(x, n, N, conf.level, details = FALSE)
x |
integer representing the number of white balls in the drawn balls. |
n |
integer representing the number of balls we draw in the urn without replacement, i.e., the sample size. |
N |
integer representing the number of all balls in an urn, i.e., the population size. |
conf.level |
the confidence level of confidence interval. |
details |
TRUE/FALSE, can be abbreviate. If choose FALSE, the confidence interval at the observed X will be returned. If choose TRUE, the confidence intervals for all sample points and the infimum coverage probability will be returned. Default is FALSE. |
Suppose X~Hyper(M,N,n). When N and n are known, Wang (2015) construct an admissible confidence interval for N by uniformly shrinking the initial 1-alpha Clopper-Pearson type interval from the mid-point of the sample space to 0. This interval is admissible so that any proper sub-interval of it cannot assure the confidence coefficient. This means the interval cannot be shortened anymore.
a list which contains i) the confidence interval for M, ii)the confidence interval for p=M/N (this interval is equal to the previous interval divided by N) and iii) the infimum coverage probability of the two intervals.
Wang, W. (2015). Exact Optimal Confidence Intervals for Hypergeometric Parameters. "Journal of the American Statistical Association" 110 (512): 1491-1499.
WhyperCI_M(0,50,2000,0.95,details = TRUE) WhyperCI_M(0,50,2000,0.95)
WhyperCI_M(0,50,2000,0.95,details = TRUE) WhyperCI_M(0,50,2000,0.95)
The 1-alpha Clopper-Pearson type lower interval for the number of white balls in an urn.
WhyperCI_M_lower(X, n, N, conf.level, details = FALSE)
WhyperCI_M_lower(X, n, N, conf.level, details = FALSE)
X |
integer representing the number of white balls we observed when drawn without replacement from an urn which contains both black and white balls. |
n |
the number we drawn. |
N |
integer representing the number of the whole balls in an urn. |
conf.level |
the confidence level of confidence interval. |
details |
TRUE/FALSE, can be abbreviate. Default is FALSE. If choose TRUE, the confidence intervals for the whole sample space and the icp will be returned. |
a list which contains the confidence interval.
Konijn, H. S. (1973). Statistical Theory of Sample Survey Design and Analysis, Amsterdam: North-Holland.
WhyperCI_M_lower(0,50,2000,0.95,details = TRUE) WhyperCI_M_lower(0,50,2000,0.95)
WhyperCI_M_lower(0,50,2000,0.95,details = TRUE) WhyperCI_M_lower(0,50,2000,0.95)
The 1-alpha Clopper-Pearson type upper interval for the number of white balls in an urn.
WhyperCI_M_upper(X, n, N, conf.level, details = FALSE)
WhyperCI_M_upper(X, n, N, conf.level, details = FALSE)
X |
integer representing the number of white balls we observed when drawn without replacement from an urn which contains both black and white balls. |
n |
the number we drawn. |
N |
integer representing the number of the whole balls in an urn. |
conf.level |
the confidence level of confidence interval. |
details |
TRUE/FALSE, can be abbreviate. Default is FALSE. If choose TRUE, the confidence intervals for the whole sample space and the icp will be returned. |
a list which contains the confidence interval.
Konijn, H. S. (1973). Statistical Theory of Sample Survey Design and Analysis, Amsterdam: North-Holland.
WhyperCI_M_upper(0,50,2000,0.95,details = TRUE) WhyperCI_M_upper(0,50,2000,0.95)
WhyperCI_M_upper(0,50,2000,0.95,details = TRUE) WhyperCI_M_upper(0,50,2000,0.95)
An admissible exact confidence interval for the number of balls in an urn, which is the population number of a hypergeometric distribution. This function can be used to calculate the interval constructed method proposed by Wang (2015).
WhyperCI_N(x, n, M, conf.level, details = FALSE)
WhyperCI_N(x, n, M, conf.level, details = FALSE)
x |
integer representing the number of white balls in the drawn balls. |
n |
integer representing the number of balls we draw in the urn without replacement, i.e., the sample size. |
M |
the number of white balls in the urn. |
conf.level |
the confidence level of confidence interval. |
details |
TRUE/FALSE, can be abbreviate. If choose FALSE, the confidence interval at the observed X will be returned. If choose TRUE, the confidence intervals for all sample points and the infimum coverage probability will be returned. Default is FALSE. |
Suppose X~Hyper(M,N,n). When M and n are known, Wang (2015) construct an admissible confidence interval for N by uniformly shrinking the initial 1-alpha Clopper-Pearson type interval from 0 to min(M,n). This interval is admissible so that any proper sub-interval of it cannot assure the confidence coefficient. This means the interval cannot be shortened anymore.
a list which contains i) the confidence interval for N and ii) the infimum coverage probability of the intervals.
Wang, W. (2015). Exact Optimal Confidence Intervals for Hypergeometric Parameters. "Journal of the American Statistical Association" 110 (512): 1491-1499.
WhyperCI_N(10,50,800,0.95,details=TRUE) WhyperCI_N(50,50,800,0.95)
WhyperCI_N(10,50,800,0.95,details=TRUE) WhyperCI_N(50,50,800,0.95)
The 1-alpha Clopper-Pearson type lower interval for the population number of hypergeometric distribution.
WhyperCI_N_lower(x, n, M, conf.level, details = FALSE)
WhyperCI_N_lower(x, n, M, conf.level, details = FALSE)
x |
integer representing the number of white balls we observed when drawn without replacement from an urn which contains both black and white balls. |
n |
the number we drawn. |
M |
the number of the white balls. |
conf.level |
the confidence level of confidence interval. |
details |
TRUE/FALSE, can be abbreviate. Default is FALSE. If choose TRUE, the confidence intervals for the whole sample space will be returned. |
a list which contains the confidence interval.
Konijn, H. S. (1973). Statistical Theory of Sample Survey Design and Analysis, Amsterdam: North-Holland.
WhyperCI_N_lower(0,50,800,0.95,details=TRUE) WhyperCI_N_lower(0,50,800,0.95)
WhyperCI_N_lower(0,50,800,0.95,details=TRUE) WhyperCI_N_lower(0,50,800,0.95)
The 1-alpha Clopper-Pearson type upper interval for the population number of hypergeometric distribution.
WhyperCI_N_upper(x, n, M, conf.level, details = FALSE)
WhyperCI_N_upper(x, n, M, conf.level, details = FALSE)
x |
integer representing the number of white balls we observed when drawn without replacement from an urn which contains both black and white balls. |
n |
the number we drawn. |
M |
the number of the white balls. |
conf.level |
the confidence level of confidence interval. |
details |
TRUE/FALSE, can be abbreviate. Default is FALSE. If choose TRUE, the confidence intervals for the whole sample space will be returned. |
a list which contains the confidence interval.
Konijn, H. S. (1973). Statistical Theory of Sample Survey Design and Analysis, Amsterdam: North-Holland.
WhyperCI_N_upper(0,50,800,0.95,details=TRUE) WhyperCI_N_upper(0,50,800,0.95)
WhyperCI_N_upper(0,50,800,0.95,details=TRUE) WhyperCI_N_upper(0,50,800,0.95)
An admissible exact confidence interval for the Poisson mean. This function can be used to calculate the interval constructed method proposed by Wang (2014).
WpoisCI(x, conf.level = 0.95, details = FALSE)
WpoisCI(x, conf.level = 0.95, details = FALSE)
x |
the sample or the observed point. |
conf.level |
confidence level. The default is 0.95. |
details |
TRUE/FALSE, can be abbreviated. To choose whether to compute the confidence intervals for all the sample points. Default is FALSE. |
Suppose X~poi(lambda), the sample space of X is {0,1,...}. Wang (2014) proposed an admissible interval which is obtained by uniformly shrinking the initial 1-alpha Clopper-Pearson interval from 0 to the sample point of interest. This interval is admissible so that any proper sub-interval of it cannot assure the confidence coefficient. This means the interval cannot be shortened anymore.
a list which contain the confidence interval and the ICP.
Wang, W. (2014). An iterative construction of confidence intervals for a proportion. "Statistica Sinica" 24: 1389-1410.
WpoisCI(1) WpoisCI(3,details = TRUE)
WpoisCI(1) WpoisCI(3,details = TRUE)
The 1-alpha Clopper-Pearson type lower interval for the Poisson mean.
WpoisCI_lower(x, conf.level = 0.95, details = FALSE)
WpoisCI_lower(x, conf.level = 0.95, details = FALSE)
x |
the sample or the observed point. |
conf.level |
confidence level. The default is 0.95. |
details |
TRUE/FALSE, can be abbreviated. To choose whether to compute the confidence intervals for all the sample points. Default is FALSE. |
a list which contain the one-sided lower confidence interval.
Garwood, F. (1936). Fiducial Limits for the Poisson Distribution. "Biometrika" 28: 437-442.
WpoisCI_lower(1) WpoisCI_lower(3,details = TRUE)
WpoisCI_lower(1) WpoisCI_lower(3,details = TRUE)
The 1-alpha Clopper-Pearson type upper interval for the Poisson mean.
WpoisCI_upper(x, conf.level = 0.95, details = FALSE)
WpoisCI_upper(x, conf.level = 0.95, details = FALSE)
x |
the sample or the observed point. |
conf.level |
confidence level. The default is 0.95. |
details |
TRUE/FALSE, can be abbreviated. To choose whether to compute the confidence intervals for all the sample points. Default is FALSE. |
a list which contain the one-sided upper confidence interval.
Garwood, F. (1936). Fiducial Limits for the Poisson Distribution. "Biometrika" 28: 437-442.
WpoisCI_upper(1) WpoisCI_upper(3,details = TRUE)
WpoisCI_upper(1) WpoisCI_upper(3,details = TRUE)