preserve. set printback=on. * EFFECT SIZES (Version 2.0) Valentim R. Alferes, University of Coimbra (Portugal), 2014. * BETWEEN-SUBJECTS DESIGNS Completely Randomized Designs: One Factor With Two Levels. * Confidence Interval for Cohen's d (standardized mean difference) based on the Noncentral t-Distribution Input Mode: d, Ns of Groups (N1 and N2) and Confidence Level. * Program: esCIdNCT.sps. set printback=off. set ovars labels onumbers values tvars labels tnumbers labels. set olang=English small=0 errors=none decimal=dot. data list list/d(f8.4) N1(f8.0) N2(f8.0). * Enter d, N1, and N2 (by convention, N1 refers to the Experimental Group and N2 to the Comparison Group). begin data. 0.84 20 15 end data. * Enter confidence level (by default, CL=95%). compute CL=95. loop NCP=0 to 10**6. xsave outfile='%temp%\fout1'. end loop. get file='%temp%\fout1'. compute df=N1+N2-2. compute tobs=d/sqr(1/N1+1/N2). compute NCP=(NCP-5*10**5)/10**4. compute alpha1=((100-CL)/100)/2. compute alpha2=1-alpha1. compute prob=ncdf.t(tobs,df,NCP). compute test1=abs(alpha1-prob). compute test2=abs(alpha2-prob). save outfile'%temp%\fout2'. sel if(test2<10**-4). sort cases by test2(a). if ($casenum=1) NCPlower=NCP. sel if($casenum=1). save outfile'%temp%\fout3'/keep NCPlower. get file'%temp%\fout2'. sel if(test1<10**-4). sort cases by test1(a). if ($casenum=1) NCPupper=NCP. sel if($casenum=1). match files/file=*/file='%temp%\fout3'. compute p=(1-cdf.t(abs(tobs),df))*2. compute VARd=((N1+N2)/(N1*N2))+(d**2/(2*(N1+N2))). compute SEd=sqr(VARd). compute Ld=NCPlower*sqr((N1+N2)/(N1*N2)). compute Ud=NCPupper*sqr((N1+N2)/(N1*N2)). variable labels p"Sig.(2-tailed)" d"Cohen's d" tobs"t" d"Cohen's d" VARd'Variance' SEd'Standard\nError' NCPlower'Lower' NCPupper'Upper' Ld'Confidence Interval\nLower Bound' Ud'Confidence Interval\nUpper Bound' CL'Confidence Level (%)*'. formats all(f8.4) N1(f8.0) N2(f8.0) df(f8.0) Cl(f8.2). oms/select tables/if commands=["summarize"] subtypes=["case processing summary"]/destination viewer=no. summarize/tables=N1 N2 tobs df p/format=list nocasenum nototal/title='Independent-Samples t Test'/cells=none. summarize/tables=d VARd SEd/format=list nocasenum nototal/title='Standardized Effect Size'/cells=none. summarize/tables=NCPlower NCPupper/format=list nocasenum nototal/title='Noncentrality Parameters'/cells=none. summarize/tables=d Ld Ud CL/format=list nocasenum nototal/title='Confidence Interval'/cells=none /footnote "* User's specification". save outfile='%userprofile%\desktop\esCIdNCT.sav'. get file='%userprofile%\desktop\esCIdNCT.sav'. erase file='%temp%\fout1'. erase file='%temp%\fout2'. erase file='%temp%\fout3'. restore.