Date: Tue, 20 Apr 2004 10:48:13 -0500
Reply-To: Paul R Swank <Paul.R.Swank@UTH.TMC.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Paul R Swank <Paul.R.Swank@UTH.TMC.EDU>
Subject: Re: t-test proportions
Content-Type: text/plain; charset="us-ascii"
But not for a dichotomous outcome!
Paul R. Swank, Ph.D.
Professor, Developmental Pediatrics
UT Health Science Center at Houston
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Doc
Sent: Tuesday, April 20, 2004 9:24 AM
Subject: Re: t-test proportions
If your dichotomous variables are coded 0 and 1, you can use PROC TTEST to
get the results that you are looking for. Note that the PAIRED statement
was added to the PROCedure in 8.2, so it's easier to do the paired version
than it used to be.
The Z-scores that you refer to below are for the z-test (square root of the
chi-squared test). The t is the analogous t-approximation similar to
continuous data; it relies more on the central limit theorem here than for
data that are on a rational scale.
It's an approximation, for sure, but I've found it to be a pretty good one
and it has a much more succinct display than PROC FREQ.
"Groeneveld, Jim" <jim.groeneveld@VITATRON.COM> wrote in message
> Hi friends,
> I am looking for an implantation in SAS of the hypothesis tests
> My design is either two dependent (paired) or two independent samples
> A single dichotome variable has to be tested for differences between
> The difference can be described in terms of proportions (of one of the
> 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:
> I have used this program quite some time with the aggregated data.
> While searching the internet I came across a.o. the following sites:
> Both pages give formulas for proportions, which actually are the same
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
> mentiones a similar formula for t, where the pooled proportion is
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
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
> Regards - Jim.
> . . . . . . . . . . . . . . . .
> Jim Groeneveld, MSc.
> Science Team
> Vitatron B.V.
> Meander 1051
> 6825 MJ Arnhem
> Tel: +31/0 26 376 7365
> Fax: +31/0 26 376 7305
> My computer remains home, but I will attend SUGI 2004.
> [common disclaimer]