09-27-2012 02:56 PM
Hi, I am relatively new to SAS.
I have first formed deciles within each month, starting from 1965 to 2007. Now I am trying to retrieve the medians of each of the deciles within each month (i.e. Getting the medians from each decile 1 to 10 of Jan 1965, followed by decile 1 to 10 of Feb 1965... ... ..... decile 1 to 10 of Dec 2007.
I have used the following code:
This is the error from the log file:
ERROR: The number of output variables is inconsistent with the number of output names in output statement 1. Output statement will be ignored.
WARNING: No output data set(s) will be created due to error(s) in output statement(s).
ERROR: Neither the PRINT option nor a valid output statement has been given.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DECILED_MEDIANS may be incomplete. When this step was stopped there were 0 observations and 4 variables.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds
I cannot figure out where I went from. Please help!
09-27-2012 06:49 PM
I would try to make sure that my code constructs are parallel so SAS doesn't have to guess about intent of mixed syntax
n= median= /autoname autolabel;
09-28-2012 01:53 PM
I'm intrigued...this is the first time that I've seen someone take quantiles of data divided into quantiles.
Why is it that you're doing this, if you don't mind my asking?
10-01-2012 08:01 AM
Me too. And wouldn't the median of the first decile be the 5th percentile, of the second decile the 15th, etc.? Seems like it would be a lot easier to just do:
proc univariate data=originaldataset;
output out=newdataset pctlpts=5 to 95 by 10;
instead of the two step procedure.
But I could really be wrong about the median of the deciles.
10-01-2012 12:00 PM
I am actually taking the median from each decile, and not dividing the deciles again. (If I get you correctly). I am just trying to get a representative observation for each decile. Then combine all of the medians of each month for a few years. To see if a pattern exist.
10-01-2012 11:56 AM
Actually this code was just what I needed (Just a little variation from the 1 I posted earlier):
CLASS DATENEW DECILED_MAX_RET;
10-01-2012 12:22 PM
Cool! Never seen that one before, but it makes sense.
To Steve Denham:
I thought the same thing, that a median of a decile would be a p5. But I had some time, and played around with it, and with designed data values the two can be made very different, so I would definitely use UNIVARIATE and a p5 like you demonstrated rather than the decile/median combo.