Learn R Programming

jmuOutlier (version 2.2)

CI.t.test: Student's t-Confidence Interval with Finite Population Correction

Description

Performs two-sided confidence interval on population mean, allowing for a finite population correction.

Usage

CI.t.test(x, conf.level = 0.95, fpc = 1)

Arguments

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.

Value

A confidence interval for the population mean.

Details

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).

References

Scheaffer, R. L., Mendenhall, W., Ott, R. L., Gerow, K. G. (2012) Elementary Survey Sampling, 7th edition.

See Also

t.test and plotCI.

Examples

Run this code
# NOT RUN {
# 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 )
# }

Run the code above in your browser using DataLab