Date: Fri, 26 Oct 2001 13:01:42 -0700
Reply-To: Dale McLerran <dmclerra@MY-DEJA.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dale McLerran <dmclerra@MY-DEJA.COM>
Subject: Re: Chi-squared test when data is already tabulated
Content-Type: text/plain
Rachel,
By tabulated data, I assume that you mean that you have the
frequencies in each cell of the table. You can still use proc
freq with the chisq option. You would table the two variables
which form the contingency table, and weight each observation by
the tabulated frequency. This is demonstrated below:
data test;
x=1; y=1; n=40; output;
x=2; y=1; n=60; output;
x=1; y=2; n=30; output;
x=2; y=2; n=70; output;
run;
proc freq data=test;
weight n;
tables x*y / chisq;
run;
Best wishes,
Dale
>Date: Fri, 26 Oct 2001 11:49:14 -0700
>Reply-To: Rachel Pearce <rpearce@U.WASHINGTON.EDU>
> Rachel Pearce <rpearce@U.WASHINGTON.EDU> Chi-squared test when data is already tabulated SAS-L@LISTSERV.UGA.EDU
>Is there a way to calculate the chisquare for a table in SAS when the
>dataset
>I have is the tabulated data, not the raw observations? I can't used proc
>freq
>with the chisq option, so is there a way to do it?
>
>Rachel
---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: dmclerra@fhcrc.org
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------
------------------------------------------------------------
--== Sent via Deja.com ==--
http://www.deja.com/