feldt1 <- function(obs.a, n, k, ci = 0.95, null.a = 0) { #***********************************************************# #* program using methods described in Feldt, Woodruff & *# #* Salih (1987) Applied Psychological Measurement 11(1), *# #* pp. 93-103 to carry out omnibus inferential test of *# #* similarity of alpha values from a single sample *# #***********************************************************# # obs.a is the observed alpha # n is the sample size # k is the number of items in the measure or scale # ci is the width of the confidence interval about obs.a desired if((ci >= 1) || (ci < 0)) return("ci must be between 0 and 1") ci.perc <- 100 * ci # purely for printing as a percentage # null.a is the null model alpha, usually zero # the testing of the observed against the null is a simple F test if(obs.a > null.a) f <- (1 - obs.a)/(1 - null.a) else f <- (1 - null.a)/(1 - obs.a) # allows for testing against a higher null n.den <- (n - 1) * (k - 1) n.num <- n - 1 null.p <- pf(f, n.num, n.den) # set the upper and lower p values for the desired C.I. p1 <- (1 - ci)/2 p2 <- ci + p1 # corresponding F values f1 <- qf(p1, n.num, n.den) f2 <- qf(p2, n.num, n.den) # confidence interval lwr <- 1 - (1 - obs.a) * f2 upr <- 1 - (1 - obs.a) * f1 cat("Given:", fill = T) cat(" Observed alpha = ", obs.a, fill = T) cat(" n = ", n, fill = T) cat(" Number of items = ", k, fill = T) cat(" and null hypothesis population alpha = ", null.a, fill = T) cat(" P against one-tailed alternative populn. alpha of ", null.a, " is ", round(null.p, 5), fill = T) cat(" ", ci.perc, "% confidence interval from ", round(lwr, 3), " to ", round(upr, 3)) cat("\n") }