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 (July 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 2 Jul 2008 23:16:37 -0400
Reply-To:     SAS_learner <proccontents@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         SAS_learner <proccontents@GMAIL.COM>
Subject:      Proc Transpose question (I think)
Content-Type: text/plain; charset=ISO-8859-1

Hello guys,

I have 10 variables (Baseline,Screening, Day1--Day8) Got their Mean,Median,Std,,Max,Min using following macro, But when I am transposing the dataset I am not getting results I wanted I am getting 13 variables (Including _type_ ,_freq_, and trtgrp1(two treatment groups ) But I want the all the summery results as one variable. Can any of guys guide how to do that with out the bunch of if else statements . thanks

%macro stat(indata= , trt= , Outdata = ,v1= ) ; Proc means data= &indata. noprint ; class Study_day &trt. ; var mequiv ; output out = &outdata.(Where =(_type_ = 3) ) mean= mean_&v1. median=median_&v1. std=std_&v1. Max = Max_&v1. Min = Min_&v1. ; run; Data &outdata.; set &outdata.; Col1 = Strip(Put(mean_&v1.,8.2))!!"("!! Strip(Put(std_&v1.,8.3))!!")"; Col2 = Strip(Put(median_&v1.,8.2) ) ; Col3 = "("!!Strip(Put(Max_&v1.,best.))!!","!!Strip(Put(Min_&v1.,best.))!!")"; keep Study_day trtgrp1 _freq_ Col1 Col2 Col3 ; run; Proc Sort data = &outdata.; by trtgrp1; run; Proc Transpose data = &outdata. Out = &outdata._tranas; By trtgrp1 Study_day; var Col1 Col2 Col3 ; Id Study_day ; Run;

%mend ;

%stat (indata = Op4_1 ,trt= trtgrp1 ,Outdata = aaa ,v1 =t1);


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