- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have entered a contingency table. How to compute z statistic to test p1=p2 (two independent proportions) in SAS. What procedure should I use. I don't seem to find it in proc freq output. How should I determine whether or not to pool when computing the standard error?
data seatbelts; input seatbelt $ injury $ count; cards; no yes 1601 no no 162000 yes yes 510 yes no 412000 ; ods graphics on; ods exclude FishersExact; proc freq data = seatbelts order=data ; weight count; tables seatbelt*injury/norow nocol nopercent expected chisq relrisk riskdiff alpha = .05; run;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Looking up riskdiff in proc freq opened up all sorts of topics. I am staying with the very simple hypothesis test of P1 = P2 where under Ho p1=p2. I wrote a macro to do what I'm looking for in the SAS output. Please see the attached file.
With all the different options I settled upon the following tables statement:
tables race*party/norow nocol nopercent expected chisq relrisk riskdiff(equal var = null cl=wald) alpha = .05;
Am I saying that I'm assuming equal variances of the two proportions in "equal var=null"? I am avoiding the very complicated discussions seeing in the users guide and trying to do just the basic test of equal proportions at this time. We can pool or use individual variances in the denominator of the z statistic. Further I would like to clarify and be sure of the syntax for cl=wald and cl=score when using the equal var=null statement.
I find I need to code what I think SAS is outputting to verify. Finally, are equations for z, confidence interval limits for z etc. listed somewhere in the proc freq users guide?