[R] test h-f sphericity test?

About this list Date view Thread view Subject view Author view Attachment view

From: John Christie (jc@or.psychology.dal.ca)
Date: Wed 24 Dec 2003 - 11:40:48 EST


Message-id: <D11C9906-35A9-11D8-985C-000A956DE534@or.psychology.dal.ca>


        I posted some R code that could be an h-f sphericity test. Is there
anyone out there with SPSS, Systat, or some other package that has a
built in test who can verify whether it is accurate or not?

John

(here is the code again)
# This returns the Huynh-Feldt or "Box Correction" for degrees of
freedom
hf <- function(m){
        # m is a matrix with subjects as rows and conditions as columns
        # note that checking for worst case scenarios F correction first might
        # be a good idea using J/(J-1) as the df correction factor
        n<- length(m[,1])
        J<-length(m[1,])
        X<-cov(m)*(n-1)
        r<- length(X[,1])
        D<-0
        for (i in 1: r) D<- D+ X[i,i]
        D<-D/r
        SPm<- mean(X)
        SPm2<- sum(X^2)
        SSrm<-0
        for (i in 1: r) SSrm<- SSrm + mean(X[i,])^2
        epsilon<- (J^2*(D-SPm)^2) / ((J-1) * (SPm2 - 2*J*SSrm + J^2*SPm^2))
        epsilon
}

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Thu 01 Jan 2004 - 09:20:59 EST