Skip to contents

Computes the noncentral t-based confidence interval for the population coefficient of variation, the standard deviation relative to the mean, so variability can be reported on a scale that is free of the measurement units.

Usage

ci_cv(
  cv = NULL,
  mean = NULL,
  sd = NULL,
  n = NULL,
  data = NULL,
  conf_level = 0.95,
  alpha_lower = NULL,
  alpha_upper = NULL,
  ...
)

Arguments

cv

Coefficient of variation

mean

Sample mean

sd

Sample standard deviation (square root of the unbiased estimate of the variance

n

Sample size

data

Vector of data for which the confidence interval for the coefficient of variation is to be calculated

conf_level

Desired confidence level (1-Type I error rate)

alpha_lower

The proportion of values beyond the lower limit of the confidence interval (cannot be used with conf_level)

alpha_upper

The proportion of values beyond the upper limit of the confidence interval (cannot be used with conf_level)

...

Allows one to potentially include parameter values for inner functions

Value

A 4-row data.frame with columns term, value, prob_less, and prob_greater. The rows are ordered so the two point estimates sit between the confidence limits: "lower_limit" (lower confidence limit on the coefficient of variation), "c_of_v" (the sample coefficient of variation), "c_of_v_unbiased" (the unbiased estimator), and "upper_limit" (upper confidence limit). The prob_less and prob_greater columns report the achieved tail probabilities of the noncentral t search at the limit values; they are NA for the point-estimate rows.

Details

Uses the noncentral t-distribution to calculate the confidence interval for the population coefficient of variation.

References

Johnson, N. L., & Welch, B. L. (1940). Applications of the non-central t-distribution. Biometrika, 31(3–4), 362–389. doi:10.1093/biomet/31.3-4.362

Kelley, K. (2007). Sample size planning for the coefficient of variation from the accuracy in parameter estimation approach. Behavior Research Methods, 39(4), 755–766. doi:10.3758/BF03192966

Kelley, K. (2007). Confidence intervals for standardized effect sizes: Theory, application, and implementation. Journal of Statistical Software, 20(8), 1–24. doi:10.18637/jss.v020.i08

Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). Designing experiments and analyzing data: A model comparison perspective (4th ed.). Routledge. (See Chapter 3.)

McKay, A. T. (1932). Distribution of the coefficient of variation and the extended t distribution. Journal of the Royal Statistical Society, 95(4), 695–698.

Author

Ken Kelley kkelley@nd.edu

Examples

set.seed(113)
N <- 15
X <- rnorm(N, 5, 1)
mean.X <- mean(X)
sd.X <- var(X)^.5

ci_cv(mean = mean.X, sd = sd.X, n = N, alpha_lower = .025,
alpha_upper = .025, conf_level = NULL)
#>  term            value prob_less prob_greater
#>  lower_limit     0.15  0.025     0.975       
#>  c_of_v          0.207 <NA>      <NA>        
#>  c_of_v_unbiased 0.21  <NA>      <NA>        
#>  upper_limit     0.335 0.975     0.025       
ci_cv(data = X, conf_level = .95)
#>  term            value prob_less prob_greater
#>  lower_limit     0.15  0.025     0.975       
#>  c_of_v          0.207 <NA>      <NA>        
#>  c_of_v_unbiased 0.21  <NA>      <NA>        
#>  upper_limit     0.335 0.975     0.025       
#> 
#> Confidence level: 95%
ci_cv(cv = sd.X / mean.X, n = N, conf_level = .95)
#>  term            value prob_less prob_greater
#>  lower_limit     0.15  0.025     0.975       
#>  c_of_v          0.207 <NA>      <NA>        
#>  c_of_v_unbiased 0.21  <NA>      <NA>        
#>  upper_limit     0.335 0.975     0.025       
#> 
#> Confidence level: 95%