| CI.t.test | R Documentation |
Performs two-sided confidence interval on population mean, allowing for a finite population correction.
CI.t.test(x, conf.level = 0.95, fpc = 1)
x |
A nonempty numeric vector of data values. |
conf.level |
Confidence level of the interval, and should be between 0 and 1. |
fpc |
The finite population correction, and should be between 0 and 1. |
The fpc is typically defined as 1-n/N, where n is the sample size,
and N is the population size, for simple random sampling without replacement.
When sampling with replacement, set fpc=1 (default).
A confidence interval for the population mean.
The definition of fpc is based on the textbook by
Scheaffer, Mendenhall, Ott, Gerow (2012), chapter 4.
Steven T. Garren, James Madison University, Harrisonburg, Virginia, USA
Scheaffer, R. L., Mendenhall, W., Ott, R. L., Gerow, K. G. (2012) Elementary Survey Sampling, 7th edition.
t.test and plotCI.
# Sample 43 observations from a population of 200 numbers, and compute the 95% confidence interval.
pop = sqrt(1:200) ; x1 = sample( pop, 43 ) ; print(sort(x1))
CI.t.test( x1, fpc = 1-length(x1)/length(pop) )
# Sample 14 observations from a Normal(mean=50, sd=5) distribution,
# and compute the 90% confidence interval.
x2 = rnorm( 14, 50, 5 ) ; print(sort(x2))
CI.t.test( x2, 0.9 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.