options crt ; ? ? Example of using proc MEDIAN to find the median and interquartile ? range of a series. Note that the number of obs<=0 is also printed. ? TSP 4.2A (December 1992) ? Author: Bronwyn H. Hall ? smpl 1 100 ; random x ; median x ; msd x ; random (expon,lambda=1) y ; ? try a skew distribution. median y ; msd y ; proc median series ; ? ? This proc finds the median of a series; note that ? the observations must be contiguous for this to work. ? This means the smpl must be restored on exit from this ? program. ? mmake temp series ; smpl 1 @nob ; unmake temp temps ; sort temps ; set n1 = int(@nob/4+.99) ; set n2 = int(@nob/2+.99) ; set n3 = int(.75*@nob+.99) ; set q1 = temps(n1) ; set med = temps(n2) ; set q3 = temps(n3) ; print q1 med q3 ; dtemp = temps<=0 ; msd (noprint) dtemp ; print @sum ; endproc median ; stop ; end ;