Skip to contents

This function computes the confidence interval (CI) for the weighted sample mean.

Usage

ciwm(x, weights, ..., confidence = 0.95, distribution = "normal", n)

Arguments

x

vector of measurements

weights

vector of weights

...

further arguments to sewm

confidence

the desired confidence level

distribution

sampling distribution of the estimate. Use normal if the population has unknown mean and known variance (or if n is large), t if population has unknown mean and variance

n

sample size, used to compute the degrees of freedom if distribution = "t"

Value

list containing three elements

m

sample mean

sem

standard error of the mean

ci

confidence interval for the sample mean

Details

The confidence interval of the weighted sample mean provides additional information about the variability of the population parameter estimate. It is defined as

$$CI = mean \pm \textit{critical value} \times \textit{standard error of the mean (SEM)}$$

where \(mean = \frac{\sum_{i=1}^{n} w_{i} x_{i}}{\sum_{i=1}^{n} w_{i}}\) is the weighted mean.

See also

ci for more information on confidence intervals, sewm for the standard error of the weighted sample mean.

Author

Alessandro Barberis