/* Comparing two proportions using pooled standard errors. www.estat.us */ data homework; /*percent from group A*/ measure1=.07; /*percent from group B*/ measure2=.1; /*Ns for the two groups*/ n1=500; n2=500; /*standard errors for group A*/ x1=(measure1*(1-measure1)); Error1=sqrt(x1/(n1) ); /*standard errors for group B*/ x2=(measure2*(1-measure2)); Error2=sqrt(x2/(n2) ); /*getting T-statistic by deviding a) difference in probability by b) pooled standard errors */ DIFZ= (measure1 - measure2)/sqrt(error1**2+error2**2); /*evaluating the T-statisic by Z-distribution*/ DIFProb=probnorm(DIFZ); /*Give a * if the difference in the probabilities is statistically siginificant at 5% level*/ if DIFPROB < .05 and DIFPROB ne . then DIFtest="*"; run; proc print; run;