MeanCIn.Rd
Returns the required sample size to obtain a given width of a confidence interval for the sample mean. The function uses uniroot()
to find a numeric solution. The t distribution is used.
MeanCIn(ci, sd, interval = c(2, 100000), conf.level = 0.95,
norm = FALSE, tol = .Machine$double.eps^0.5)
the left and right bound of the interval, which is presumed to be symmetric.
the standard deviation of the sample.
the interval for the sample size to be searched into, (default is c(2, 100000)).
confidence level, defaults to 0.95
.
logical, determining if the t- or normaldistribution should be used.
the desired accuracy (convergence tolerance).
The required sample sizes for a specific width of confidence interval for the mean depends recursively on the sample size, as the samplesize defines the degrees of freedom in the t-distribution. Although in most practical cases it will be sufficient to use the normal distribution, we might be interested in exact results.
a numeric value
BinomCIn()
MeanCIn(ci=c(25, 27), sd=5)
#> [1] 98.46626