```Date: Sat, 18 Oct 2008 01:45:39 -0700 Reply-To: wwmz Sender: "SAS(r) Discussion" From: wwmz Organization: http://groups.google.com Subject: Re: How to get std residuals of chi-square test? Comments: To: sas-l@uga.edu Content-Type: text/plain; charset=ISO-8859-1 Thanks Dan and Robin for your kindly help. Dan I just want to see how it distributed. u method is simple, but i cannot directly use it as i use different formula, thx anyway. I wrote some code using proc iml to calculate it. something like: (t is the matrix of the table) n_j=t[+,]; /* N+j */ n_i=t[,+]; /* Ni+ */ N=sum(n_j); /* N++ */ expect=n_i*n_j/N; /* expected values */ residual=(t-expect)/(expect#(1-n_i/N)#(1-n_j/N))##0.5; .. Robin I am not familar with Proc genmod. I noticed that it use poisson distribution in your code, if use differernt distribution, it may give differernt std residuals? then which one is right or better? Thanks again! On Oct 17, 7:09 am, rh...@UNMC.EDU (Robin R High) wrote: > PROC GENMOD easily gives you the chi square residuals and standardized chi > square residuals (among others), where the standardized residual include > the elements of the "hat" matrix (formula is in the GENMOD documentation). > > proc genmod data=gg; > class a b ; > model freq = a b /DIST=POISSON LINK=LOG; > OUTPUT OUT=resid predicted=pred resraw=resraw reschi=reschi stdreschi= > stdreschi; > run; > > proc print data=resid; run; > run; > > The standardized residuals would be exceedingly difficult to compute from > the output of PROC FREQ. > > Robin High > UNMC > > wwmz > Sent by: "SAS(r) Discussion" > 10/16/2008 07:10 PM > Please respond to > wwmz > > To > SA...@LISTSERV.UGA.EDU > cc > > Subject > How to get std residuals of chi-square test? > > i am trying to use proc freq to run a chi-square test for a > contingency table , but i have problem to get the std residuals from > the test. I cannot find any option to do that. Is there any way to get > it using SAS or i have to calculate by myself? > > Thanks! ```

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