LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2010, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 27 Sep 2010 06:56:11 -0500
Reply-To:     "Data _null_;" <iebupdte@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Data _null_;" <iebupdte@GMAIL.COM>
Subject:      Re: Easier way to produce tables
Comments: To: SUBSCRIBE SAS-L Olivier Van Parys <>
In-Reply-To:  <>
Content-Type: text/plain; charset=ISO-8859-1

Maybe you can just transpose.

data test; array pred[10]; do id = 1 to 10; do i = 1 to dim(pred); pred[i] = rantbl(1234,.5)-1; end; y = rannor(0) * 5 + 10; output; end; run; proc transpose name=table out=test2(rename=col1=pred); by id y; var pred:; run; proc sort data=test2 SORTSEQ=LINGUISTIC(NUMERIC_COLLATION=ON); by table; run; proc summary data=test2; by table; class pred; var y; output out=tables; run; proc print; run;

On Mon, Sep 27, 2010 at 4:48 AM, SUBSCRIBE SAS-L Olivier Van Parys <> wrote: > Hi Folks, > > I am trying to change a bad habit I have have acquired, when checking > predictor in a model with Y as the variable to predict and Pred1... PredN > representing N binomial predictors - I usually run the following: > proc summary data=DB; > class Pred1; > var Y; > output out=table_pred1; > ... > proc summary data=DB; > class PredN; > var Y; > output out=table_predN; > > That give me N table which I then collate back together using excel. This > obviously ends up being a rather time consuming & tedious process. I was > wondering what would be a better /more efficient syntax to produce the final > table (i.e. A single table with Predictors on each row showing the average Y > when Pred=1 or Pred=0). > > Thanks again for your tips, > > Olivier >

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