LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 19 Apr 2004 09:32:32 +0200
Reply-To:   "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Subject:   Re: t-test proportions
Comments:   To: Michelle Harrison <Michelle.Harrison@hunter.health.nsw.gov.au>
Comments:   cc: allstat@JISCMAIL.AC.UK
Content-Type:   text/plain; charset="iso-8859-1"

Dear Michelle, It may be evident by now, that the best test to use in the described case is the McNemar Q test, part of PROC FREQ (AGREE option on TABLES statement). Most replies to me have gone via the list SAS-L, so you've seen them as well. I'll still have a look at the alternatives, when I've left some time. (Allstat readers only may have a look at the SAS-L archives at http://listserv.uga.edu/archives/sas-l.html, searching for the subject as above.) Regards - Jim.

-- . . . . . . . . . . . . . . . .

Jim Groeneveld, MSc. Biostatistician Science Team Vitatron B.V. Meander 1051 6825 MJ Arnhem Tel: +31/0 26 376 7365 Fax: +31/0 26 376 7305 Jim.Groeneveld@Vitatron.com www.vitatron.com

My computer remains home, but I will attend SUGI 2004.

[common disclaimer]

-----Original Message----- From: Michelle Harrison [mailto:Michelle.Harrison@hunter.health.nsw.gov.au] Sent: Friday, April 16, 2004 00:18 To: Groeneveld, Jim Subject: Re: t-test proportions

Hi Jim, Can you please forward your responses to me as I am interested in this as well. Cheers, Michelle ********************************************** Michelle Harrison Statistician Hunter Population Health Locked Bag 10, Wallsend NSW 2287 Phone (02) 4924 6381 Fax (02) 4924 6490 www.hcha.org.au **********************************************

>>> "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM> 15/04/2004 10:19:02 pm >>> Hi friends,

I am looking for an implantation in SAS of the hypothesis tests described below. My design is either two dependent (paired) or two independent samples (groups). A single dichotome variable has to be tested for differences between both groups. The difference can be described in terms of proportions (of one of the two values) and group sizes only.

In the book <<Introduction to Statistical Analysis and Inference for Psychology and Education, by Sidney J. Armore, 1970>> a t-test for proportions between independent groups is outlined. Based on that I wrote a simple Fortran (Fortran 4 or Fortran 66 as it was called on an already extinct mainframe computer) program some 25 years ago, which calculated z-scores from both proportions (or percentages) and group sizes. The partial code, from which the used formula may be evident, is: POOLED=(PROP1*N1+PROP2*N2)/(N1+N2) ZSCORE=(PROP1-PROP2)/SQRT(POOLED*(1.-POOLED)*(1./N1+1./N2)) I have used this program quite some time with the aggregated data.

While searching the internet I came across a.o. the following sites: http://courses.smsu.edu/nkk661f/QBA337/handout4.htm http://www.stat.sc.edu/curricula/courses/515/515SAS.html#9p3 Both pages give formulas for proportions, which actually are the same in both of them. Their formula is: z = (p1 - p2) / sqrt ( (P x (1-P) / n1 ) + (P x (1-P) / n2 ) ) where P = pooled proportion: (p1n1 + p2n2) / (n1 + n2) This is the same formula I used to use.

The web page http://www.ocair.org/files/KnowledgeBase/Statistics/Proportion.htm mentiones a similar formula for t, where the pooled proportion is replaced by the group proportions: t = (p1 - p2) / sqrt ( (p1 x (1-p1) / n1 ) + (p2 x (1-p2) / n2 ) )

These sites apparently give code to calculate the p-values using data step code, but now I would like to know how I can calculate the same from the individual data using a standard SAS PROCedure. So I would like to avoid writing some algorithm in a data step, because that would have to be validated. I know I also could apply a Chi-square.

And additional to that I also would like to know how to do it with a standard SAS PROCedure with dependent (paired) groups (repeated measures), i.e. comparing the proportions of two different dichotome variables within one sample.

Regards - Jim. -- . . . . . . . . . . . . . . . .

Jim Groeneveld, MSc. Biostatistician Science Team Vitatron B.V. Meander 1051 6825 MJ Arnhem Tel: +31/0 26 376 7365 Fax: +31/0 26 376 7305 Jim.Groeneveld@Vitatron.com www.vitatron.com <http://www.vitatron.com/>

My computer remains home, but I will attend SUGI 2004.

[common disclaimer]


Back to: Top of message | Previous page | Main SAS-L page