I'm trying to use a alias to create multiple statistics for the same variable in PROC REPORT.
data have1;
input username $ betdate : datetime. stake winnings;
dateOnly = datepart(betdate) ;
format betdate DATETIME.;
format dateOnly ddmmyy8.;
datalines;
player1 12NOV2008:12:04:01 90 -90
player1 04NOV2008:09:03:44 100 40
player2 07NOV2008:14:03:33 120 -120
player1 05NOV2008:09:00:00 50 15
player1 05NOV2008:09:05:00 30 5
player1 05NOV2008:09:00:05 20 10
player2 09NOV2008:10:05:10 10 -10
player2 15NOV2008:15:05:33 35 -35
player1 15NOV2008:15:05:33 35 15
player1 15NOV2008:15:05:33 35 15
run;
PROC PRINT; RUN;
Proc rank data=have1 ties=mean out=ranksout groups=2;
var stake;
ranks stakeRank;
run;
I want to add an extra, computed variable to the report above. What am I doing wrong here? I'm sure it's just a small syntax issue, but I'm having no luck with it!
PROC REPORT DATA=ranksout1 NOWINDOWS;
COLUMN stakerank stake, (n mean stake=discountedstake);
DEFINE stakerank / GROUP id 'Rank for Variable Stake' ORDER=INTERNAL;
DEFINE stake / ANALYSIS '';
define n/format=8. ;
define discountedstake / analysis format=8.2;
compute discountedstake;
discountedstake = stake * 0.9;
endcompute;
RUN;
Thanks.