LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (June 1997, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 20 Jun 1997 13:27:13 -0400
Reply-To:     rcoleman@worldnet.att.net
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Ron Coleman <rcoleman@WORLDNET.ATT.NET>
Organization: Links Analytical, Inc.
Subject:      Re: Medians in Proc Tabulate
Content-Type: text/plain; charset=us-ascii

Unfortunately, PROC TABULATE does not do medians. You can use PROC UNIVARIATE for any percentiles including 50th (median).

proc univariate data=SS.LOADS ; by staid; var basload totload; run;

Ron

L. Joseph Bachman wrote: > > I have a large data set of the following format: > > STA-ID YEAR BASELOAD TOTAL_LOAD, etc..... > > 1 1991 34 56 > 1 1992 45 89 > 1 1993 32 67 > 1 1994 42 56 > 2 1972 103 120 > 2 1973 110 130 > 2 1974 140 180 > . > . > etc... > > I want to make a table that will give me the median values over all years > for each STA-ID. The closest thing I could figure out to do was use PROC > TABULATE (Through the tables function in ASSIST): > > ---begin included SAS code file------ > > /*------------------------------------------------------------------* > | Summary: | > | This program creates a simple tabular report using the | > | data set SS.LOADS and displaying across levels of | > | analysis variables and statistics and a down level of | > | classification variables. | > | Generated: 19JUN97 11:14:45 | > *------------------------------------------------------------------* > | The OPTIONS statement specifies the dimensions of the printed | > | output in characters per line and lines per page and whether or | > | not the current date and page number are printed. | > | The TITLE and FOOTNOTE statements clear any previously defined | > | titles or footnotes. | > *------------------------------------------------------------------*/ > options linesize=132 pagesize=26 date number pageno=1; > title; > footnote; > proc tabulate data=SS.LOADS ; > table STAID > ,(BASELOAD TOTLOAD) * ( 'N' 'MEAN') > > ; > var BASELOAD TOTLOAD; > class STAID; > run; > > -------end included SAS code file ---- > > This produced output of the form... > > ------------------------------------------------------------------------ > | |baseflow nitrate load, in| total nitrate load, in | > | | tons | tons | > | |-------------------------+-------------------------+ > | | N | MEAN | N | MEAN | > |------------------+------------+------------+------------+------------+ > |station ID | | | | | > |------------------| | | | | > |01491000 | 8.00| 83.88| 19.00| 120.15| > |------------------+------------+------------+------------+------------+ > |01493500 | 0.00| .| 18.00| 17.86| > |------------------+------------+------------+------------+------------+ > |01503000 | 13.00| 1646.18| 16.00| 2695.56| > |------------------+------------+------------+------------+------------+ > |01509150 | 5.00| 6.98| 6.00| 12.82| > |------------------+------------+------------+------------+------------+ > |01518000 | 11.00| 74.21| 11.00| 269.55| > |------------------+------------+------------+------------+------------+ > |01518700 | 14.00| 128.41| 16.00| 319.16| > |------------------+------------+------------+------------+------------+ > |01520000 | 8.00| 154.81| 21.00| 278.57| > ------------------------------------------------------------------------ > > Which is what I want, except for one thing. Proc tabluate appears to have a > limited list of summary statistics available to it. I had wanted to tabulate > _medians_ for these stations, but instead the on thing available was _means_. > > Is there some other way I can generate such a table, and be able to have medians > computed? Also, would it be possible to display the minimum and maximum years > for each sation in the same table? > > Thanks in advance for yur suggestions. > > Joe Bachman > jbachman@usgs.gov

-- Ron Coleman A SAS Quality Partner. Links Analytical, Inc. Linking your data to your business! 3545-1 St. Johns Bluff Rd. Suite 300 Jacksonville FL 32224 rcoleman@worldnet.att.net


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