ci.mean.gen: Confidence intervals for generalized means

View source: R/statpsych1.R

ci.mean.genR Documentation

Confidence intervals for generalized means

Description

Computes confidence intervals for three population generalized means (square-root, geometric, and harmonic) using a vector of response scores as input. The square-root mean requires non-negative scores. The geometric and harmonic means require positive scores. The standard errors are recovered from the confidence intervals.

Usage

ci.mean.gen(alpha, y)

Arguments

alpha

alpha level for 1-alpha confidence

y

vector of scores

Value

Returns a 1-row matrix. The columns are:

  • Estimate - estimated mean

  • SE - recovered standard error

  • LL - lower limit of the confidence interval

  • UL - upper limit of the confidence interval

Examples

y <- c(32, 47, 28, 15, 20, 41, 87)
ci.mean.gen(.05, y)

# Should return:
#             Estimate       SE       LL       UL
# Square-root 35.79395 8.141122 18.64498 58.48619
# Geometric   33.26410 7.633328 19.47124 56.82741
# Harmonic    29.07073 7.978149 19.35236 58.39602
 


statpsych documentation built on Jan. 13, 2026, 1:07 a.m.