VIEWS: 8 PAGES: 6 POSTED ON: 6/28/2012 Public Domain
Confidence Interval for Standardized Difference Between Means, Related Samples You cannot use my Conf_Interval-d2.sas program to construct a confidence interval for d when the data are from correlated samples. With correlated samples the distributions here are very complex, not following the noncentral t. You can construct an approximate confidence g2 2(1 r12 ) interval, g ZccSE where SE is , but such a confidence interval is not very 2(n 1) n accurate unless you have rather large sample sizes. I cannot recall where I got this formula, but suspect it was from Kline’s Beyond Significance Testing. I probably have the source at my office, but am stuck at home with a broken leg at the moment. I do have an SAS program that uses this algorithm PS: I use “g” to symbolize the sample estimate of Cohen’s d. Algina & Kesselman (2003) provided a new method for computing confidence intervals for the standardized difference between means. I shall illustrate that method here. Run this SAS code: options pageno=min nodate formdlim='-'; ******************************************************************************; title 'Experiment 2 of Karl''s Dissertation'; title2 'Correlated t-tests, Visits to Mus Tunnel vs Rat Tunnel, Three Nursing Groups '; run; data Mus; infile 'C:\D\StatData\tunnel2.dat'; input nurs $ 1-2 L1 3-5 L2 6-8 t1 9-11 t2 12-14 v_mus 15-16 v_rat 17-18; v_diff=v_mus - v_rat; proc means mean stddev n skewness kurtosis t prt; var v_mus V_rat v_diff; run; *****************************************************************************; Proc Corr Cov; var V_Mus V_Rat; run; Get this output -------------------------------------------------------------------------------------------------- Experiment 2 of Karl's Dissertation 1 Correlated t-tests, Visits to Mus Tunnel vs Rat Tunnel, Three Nursing Groups The MEANS Procedure Variable Mean Std Dev N Skewness Kurtosis t Value Pr > |t| ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ v_mus 22.7291667 10.4428324 48 -0.2582662 -0.3846768 15.08 <.0001 v_rat 13.2916667 10.4656649 48 0.8021143 0.2278957 8.80 <.0001 v_diff 9.4375000 11.6343334 48 -0.0905790 -0.6141338 5.62 <.0001 ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ 2 The CORR Procedure Covariance Matrix, DF = 47 v_mus v_rat v_mus 109.0527482 41.6125887 v_rat 41.6125887 109.5301418 Pearson Correlation Coefficients, N = 48 Prob > |r| under H0: Rho=0 v_mus v_rat v_rat 0.38075 1.00000 0.0076 To obtain our estimate of the standardized difference between mean, run this SAS code: Data G; M1 = 22.72917 ; SD1 = 10.44283; M2 = 13.29167 ; SD2 = 10.46566; g = (m1-m2) / SQRT(.5*(sd1*sd1+sd2*sd2)); run; Proc print; var g; run; Obtain this result: Obs g 1 0.90274 Using the approximation method first presented, .902742 2(1 .38075) SE 0.18567 . A 95% CI is .90274(1.96)(.18567) = [.539, 1.267]. 2( 48 1) 48 From James Algina’s webpage, I obtained a simple SAS program for the confidence interval. Here is it, with values from above. *This program computes an approximate CI for the effect size in a within-subjects design with two groups. m2 and m1 are the means for the two groups s1 and s2 are the standard deviations for the two groups n1 and n2 are the sample sizes for the two groups r is the correlation prob is the confidence level; data; m1=22.7291667 ; m2=13.2916667 ; s1=10.4428324 ; s2=10.4656649 ; 3 r= 0.38075 ; n=48 ; prob=.95 ; v1=s1**2; v2=s2**2; s12=s1*s2*r; se=sqrt((v1+v2-2*s12)/n); pvar=(v1+v2)/2; nchat=(m1-m2)/se; es=(m1-m2)/(sqrt(pvar)); df=n-1; ncu=TNONCT(nchat,df,(1-prob)/2); ncl=TNONCT(nchat,df,1-(1-prob)/2); ul=se*ncu/(sqrt(pvar)); ll=se*ncl/(sqrt(pvar)); output; proc print; title1 'll is the lower limit and ul is the upper limit'; title2 'of a confidence interval for the effect size'; var es ll ul ; run; quit; Here is the result: ll is the lower limit and ul is the upper limit 4 of a confidence interval for the effect size Obs es ll ul 1 0.90274 0.53546 1.26275 The program presented by Algina & Keselman (2003) is available at another of Algina’s web pages . This program will compute confidence intervals for one or more standardized contrasts between related means, with or without a Bonferroni correction, and with or without pooling the variances across all groups. Here is code, modified to compare the two related means from above. * This program is used with within-subjects designs. It computes confidence intervals for effect size estimates. To use the program one inputs at the top of the program: m--a vector of means v--a covariance matrix in lower diagonal form, with periods for the upper elements n--the sample size prob--the confidence level prior to the Bonferroni adjustment adjust--the number of contrats is a Bonferroni adjustment to the confidence level is requested. Otherwise adjust is set equal to 1 Bird--a switch that uses the variances of all variables to calculate the denominator of the effect size as suggested by K. Bird (Bird=1). Our suggestion is to use the variance of those variables involved in the contrast to calculate the denominator of the effect size (Bird=0) 4 In addition one inputs at the bottom of the program: c--a vector of contrast weights multiple contrasts can be entered. After each, type the code run ci; proc iml; m={ 22.72917 13.29167}; v={109.0527482 . , 41.6125887 109.5301418}; do ii = 1 to nrow(v)-1; do jj = ii+1 to nrow(v); v[ii,jj]=v[jj,ii]; end; end; n=48 ; Bird=1; df=n-1; cl=.95; adjust=1; prob=cl; print 'Vector of means:'; print m; print 'Covariance matrix:'; print v; print 'Sample size:'; print n; print 'Confidence level before Bonferroni adjustment:'; print cl; cl=1-(1-prob)/adjust; print 'Confidence level with Bonferroni adjustment:'; print cl; start CI; pvar=0; count=0; if bird=1 then do; do mm=1 to nrow(v); if c[1,mm]^=0 then do; pvar=pvar+v[mm,mm]; count=count+1; end; end; end; if bird=0 then do; do mm=1 to nrow(v); pvar=pvar+v[mm,mm]; count=count+1; end; end; pvar=pvar/count; es=m*c`/(sqrt(pvar)); se=sqrt(c*v*c`/n); nchat=m*c`/se; ncu=TNONCT(nchat,df,(1-prob)/(2*adjust)); ncl=TNONCT(nchat,df,1-(1-prob)/(2*adjust)); ll=se*ncl/(sqrt(pvar)); ul=se*ncu/(sqrt(pvar)); print 'Contrast vector'; print c; 5 print 'Effect size:'; print es; Print 'Estimated noncentrality parameter'; print nchat; Print 'll is the lower limit of the CI and ul is the upper limit'; print ll ul; finish; c={1 -1}; run ci; quit; Here is the output: ll is the lower limit and ul is the upper limit of a confidence interval for the effect size Vector of means: m 22.72917 13.29167 Covariance matrix: v 109.05275 41.612589 41.612589 109.53014 Sample size: n 48 Confidence level before Bonferroni adjustment: cl 0.95 Confidence level with Bonferroni adjustment: cl 0.95 Contrast vector c 1 -1 6 Effect size: -------------------------------------------------------------------------------------------------- ll is the lower limit and ul is the upper limit of a confidence interval for the effect size es 0.9027425 Estimated noncentrality parameter nchat 5.619997 ll is the lower limit of the CI and ul is the upper limit ll ul 0.5354583 1.2627535 Notice that this produces the same CI produced by the shorter program. Recommended additional reading: Algina, J., & Keselman, H. J. (2003). Approximate confidence intervals for effect sizes. Educational and Psychological Measurement, 63, 537-553. DOI: 10.1177/0013164403256358 Grissom, R. J., & Kim, J. J. (2005). Effect sizes for research: A broad practical approach. Mahwah, NJ: Erlbaum. – especially pages 67 and 68 Glass, G. V., & Hopkins, K. D. Statistical Methods in Education and Psychology (2nd ed.), Prentice-Hall 1984. Section 12.12: Testing the hypothesis of equal means with paired observations, pages 240-243. Construction of the CI is shown on page 241, with a numerical example on pages 242-243. Back to Wuensch’s Stats Lessons Page