## a tweak of my feldt1 function adapting it to be used to take ## a matrix input, here with the alphas in the first column ## n's in the second, to output a listing of intervals that can ## be pasted (with suprising difficulty) into Word ## In word2k you need to convert the listing to a single column table ## and then paste that otherwise it chops it up. Hooray for M$ again! k <- 14 ## fill in the number of items here feldt1b <- function(obs.a, n, k, ci = 0.95, null.a = 0) { 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(round(lwr,2), "to",round(upr,2),"\n") # return(int) } n <- length(SM1[,1]) for (i in 1:n) { feldt1b(SM1[i,1],SM1[i,2],k) }