Date: Thu, 3 Jul 2008 10:01:34 -0400
Reply-To: SAS_learner <proccontents@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: SAS_learner <proccontents@GMAIL.COM>
Subject: Re: Proc Transpose question (I think)
In-Reply-To: <7367b4e20807030642p43f90276t3ddab840b01c481c@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
I just figured that out thank you so much data _null_
I was playing with my code and figured that out
On Thu, Jul 3, 2008 at 9:42 AM, data _null_, <datanull@gmail.com> wrote:
> Remove the ID statement in PROC TRANSPOSE.
>
> On 7/3/08, SAS_learner <proccontents@gmail.com> wrote:
> > hello all,
> >
> > My data is something like this
> >
> > Baseline Screening day1 day1 day2
> day3
> > day4 day5 day6 day7 day8 day9
> > Baseline 19
> > Baseline 19.2(2.1)
> > Baseline (20,20)
> >
> > Screening 20
> > Screening 20(3.2)
> > Screening (10,10)
> > Day1 12
> > Day1 12(2.1)
> > Day1 (13,15)
> > Day2
> > Day2
> > Day2
> > Day3
> > Day3
> > Day3
> >
> > I am having my values like this .This is result I am getting after
> > transposing the dataset I have
> >
> > Proc Transpose data = &outdata. Out = &outdata._tranas;
> > By trtgrp1 Study_day;
> > var Col1 Col2 Col3 ;
> > Id Study_day ;
> > Run;
> >
> > but I want all results like this
> >
> > Col_all
> > Baseline 19
> > Baseline 19.2(2.1)
> > Baseline (20,20)
> > Screening 20
> > Screening 20(3.2)
> > Screening (10,10)
> > Day1 12
> > Day1 12(2.1)
> > Day1 (13,15)
> > Day2 11
> > Day2 11(2.1)
> > Day2 (11,10)
> > ........
> > .................
> > Day8
> > If I can't do it in the transpose can is there way to do it in using
> nmiss
> > or ifn ??
> >
> >
> > On Wed, Jul 2, 2008 at 11:16 PM, SAS_learner <proccontents@gmail.com>
> wrote:
> >
> > > 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);
> > >
> >
>
|