R/statpsych3.R
ci.pairs.mult.Rd
Computes adjusted Wald confidence intervals for pairwise proportion differences of a multinomial variable in a single sample. These adjusted Wald confidence intervals use the same method that is used to compare the two proportions in a paired-samples design.
ci.pairs.mult(alpha, f)
alpha level for 1-alpha confidence
vector of multinomial frequency counts
Returns a matrix with the number of rows equal to the number of pairwise comparisons. The columns are:
Estimate - adjusted estimate of proportion difference
SE - adjusted standard error
LL - lower limit of the adjusted Wald confidence interval
UL - upper limit of the adjusted Wald confidence interval
Bonett DG, Price RM (2012). “Adjusted wald confidence interval for a difference of binomial proportions based on paired data.” Journal of Educational and Behavioral Statistics, 37(4), 479--488. ISSN 1076-9986, doi:10.3102/1076998611411915 .
f <- c(125, 82, 92)
ci.pairs.mult(.05, f)
#> Estimate SE LL UL
#> 1 2 0.14285714 0.04731825 0.05011508 0.23559920
#> 1 3 0.10963455 0.04875715 0.01407230 0.20519680
#> 2 3 -0.03322259 0.04403313 -0.11952594 0.05308076
# Should return:
# Estimate SE LL UL
# 1 2 0.14285714 0.04731825 0.05011508 0.23559920
# 1 3 0.10963455 0.04875715 0.01407230 0.20519680
# 2 3 -0.03322259 0.04403313 -0.11952594 0.05308076