********************************************************************************. *Description: * The following spss program calculates the statistical power for testing of fit on the basis of * the RMSEA for covariance structure models. * The SPSS code was adapted for the current research from the SAS program that was provided * in the appendix of MacCallum et al. (1996, p. 148). * * MacCallum, R. C., Browne, M. W., Sugawara, H. M. (1996). Power analysis * and determination of sample size for covariance structure modeling. * Psychological Methods, 1, 130-149. * * SPSS has no function to get the p quantile for a noncentral Chi-square distribution and * therefore it was necessary to modify the sas program of MacCallum et al. (1996) using a * program by from Keizo Hori (2000) at Kagawa University, Faculty of Economics * reproduced in Section C. * Hori, K. (2000, Feburary 19). Re: Noncentral chi-square distribution. Message * posted to SPSS List Serve, archived at http://listserv.uga.edu/cgibin/ * wa?A2=ind0002&L=spssx-l&P=R14916 * The data used within this program corresponds to that reported in table 2, page 142, from * MacCallum et al. (1996) and was used to verify the accuracy of the output against known * values reported in the published literature. * * Please see MacCallum et al. (1996) for guidelines on interpretation * * Use: Free for non-commercial use with acknowledgement.  This spss program is licensed under an Attribution-NonCommercial-ShareAlike 4.0 International. * * Suggested citation: * * Little, J. (2023). Computing power for the RMSEA (Version 1.0). * https://www.statpsychservices.com.au/resources. Melbourne: Statistical Psychological Services. * * *Writer: Jonathon Little *Date: 2006 *Version 1.0 *********************************************************************************. ****Section A******. COMPUTE df = 50./*enter the degrees of fredom here. COMPUTE alpha = .05. /*enter the alpha here. COMPUTE rmsea_h0 = .05. /*enter the value for the null hypothesis RMSEA here. COMPUTE rmsea_h1 = .08. /*enter the value for the alternative hypothesis RMSEA here. COMPUTE sampe_size = 200. /*enter the sample size here. *****DO NOT ALTER THE SYNTAX IN SECTIONS B , C or D*********************. ****Section B******. COMPUTE new_alpha = 1 - alpha. COMPUTE ncp_h0 = (sampe_size - 1)*df*rmsea_h0**2. COMPUTE ncp_h1 = (sampe_size - 1)*df*rmsea_h1**2. ****Section C****gets the the p quantile for a noncentral Chi-square distribution **. COMPUTE prec=.0000001. COMPUTE cmean=df+2*ncp_h0. COMPUTE start=cmean. COMPUTE step=start/10. LOOP i=0 to 1000. COMPUTE cval=start-step*i. END LOOP IF ((new_alpha)>ncdf.chisq(cval,df,ncp_h0)). DO IF (i=0). LOOP i=0 to 1000. COMPUTE cval=start+step*i. END LOOP IF ((new_alpha)=prec). COMPUTE intv=intv*.7. COMPUTE newn=newn +dir*intv*.5. COMPUTE new_alphaa=ncdf.chisq(newn,df,ncp_h0). COMPUTE new_alphadiff=abs(new_alphaa-new_alpha). DO IF (new_alphaa