Date: Mon, 15 Mar 1999 23:57:39 GMT ct68@columbia.edu "SAS(r) Discussion" Shiling Zhang Deja News - The Leader in Internet Discussion Re: get median of repeated measurements

Chin-Lin,

The ordinal function is really helpful. BTW, the median for 2 3 4 is 3 not 2, a typo.

Hope it helps.

164 data t1; 165 input 166 id m1 m2 m3; 167 median = ordinal(2, of m1-m3); 168 put _all_; 169 cards;

ID=1 M1=1 M2=2 M3=4 MEDIAN=2 _ERROR_=0 _N_=1 ID=2 M1=3 M2=2 M3=2 MEDIAN=2 _ERROR_=0 _N_=2 ID=3 M1=2 M2=3 M3=4 MEDIAN=3 _ERROR_=0 _N_=3 NOTE: The data set WORK.T1 has 3 observations and 5 variables. NOTE: The DATA statement used 0.11 seconds.

173 ;

In article <Pine.GSO.3.95qL.990315153050.4089C-100000@konichiwa.cc.columbia.edu>, Chin-Lin Tseng <ct68@columbia.edu> wrote: > > From lynn@watsun.cc.columbia.edu Mon Mar 15 15:29:46 1999 > Date: Mon, 15 Mar 99 11:40:16 EST > From: Lynn Rohrs <lynn@watsun.cc.columbia.edu> > To: Chin-Lin Tseng <ct68@watsun.cc.columbia.edu> > Subject: Re: get the median of repeated measurements > > hello there, > > > say repeated measuremetns are put into several variables, how to get the > > median for each subject from these repeated measurements? > > e.g. > > id m1 m2 m3 median > > 1 1 2 4 2 > > 2 3 2 2 2 > > 3 2 3 4 2 > > the median variable is the one i want to get. > > thanks. > > chin-lin > > > >

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

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