/* This program computes a test of the significance of the differences */.
/* between k independent coefficient alphas using a procedure described by */.
/* Hakstian & Whalen (1976). The syntax is HWALPHA alpha n j, where alpha */.
/* is a variable in an SPSS file containing the k values of alpha, n is the */.
/* variable in the file containing the sample sizes, and j is the variable */.
/* containing the number of items in the measure */.
/* Written by Andrew F. Hayes */.
/* The Ohio State University */.
/* School of Journalism and Communication */.
/* hayes.338@osu.edu */.
DEFINE HWALPHA (!positional !token(3)).
MATRIX.
get mat/variables = !1/missing = omit.
compute alpha = mat(:,1).
compute n=mat(:,2).
compute j=mat(:,3).
compute df = nrow(mat)-1.
compute a = ((j-1)&*((9*n-11)&**2))/((18*j)&*(n-1)).
compute top = a&*((1-alpha)&**(-1/3)).
compute bot = a&*((1-alpha)&**(-2/3)).
compute m = csum(a)-((csum(top)**2)/csum(bot)).
print/title = "** SIGNIFICANCE TEST OF THE DIFFERENCE BETWEEN INDEPENDENT ALPHA COEFFICIENTS **".
print/title = "From Hakstian & Whalen (1976), Psychometrika, 41, 219-231.".
print mat/clabels = "ALPHA" "N" "ITEMS"/title = " "/format F10.4.
compute p = 1-chicdf(m,df).
compute res = {m, df, p}.
print res/clabels = "CHISQ" "DF" "P-VALUE"/title = " "/format F10.4.
END MATRIX.
!END DEFINE.