```Date: Mon, 8 Jan 2001 08:31:28 -0800 Reply-To: "Huang, Ya" Sender: "SAS(r) Discussion" From: "Huang, Ya" Subject: Re: Help: PROC FREQ with 1000 variables.. Comments: To: Victor Aina Content-Type: multipart/alternative; Victor, A little bit of modification of my old post might get what you want: data xx (keep=vname y vvalue); set xx; length vname \$ 8; array v inquiry lien judgemnt trade sex; do over v; vvalue=v; call vname(v,vname); output; end; proc sort; by vname; proc freq data=xx noprint; output out=yy chisq; table y*vvalue / chisq; by vname; run; proc print data=yy; run; HTH Ya Huang -----Original Message----- From: Victor Aina [mailto:aina@SFU.CA] Sent: Sunday, January 07, 2001 11:10 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Help: PROC FREQ with 1000 variables.. Hello everyone: I need to run the FREQ procedure on more than 1000 variables with names like INQUIRY, LIEN, JUDGEMENT, TRADE, SEX etc. The objective is to compute the relationship of these variables with one dependent variable, say Y. I would like to extract some of the statistics generated by the PROC FREQ e.g. Chi Square value and the associated p-value for each of the variables. Then combine all these 1000 together and sort them according to say the p-value or any criteria. I've written a little macro that I can only call 1000 or more times e.g. %cfreq(dsn=data_res, dependvar =Y , indep_var =LIEN ); %cfreq(dsn=data_res, dependvar =Y , indep_var =SEX ); . . . %cfreq(dsn=data_res, dependvar =Y , indep_var =XMED ); Grateful if anyone could point me to a more efficient way of handling the programming. -- +----------------------------------------------------------+ | victor aina | e-mail: aina@sfu.ca | fax:(972) 255-6955 | [text/html] ```

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