Hi Tom, Let's assume the dataset comes with the variable REGION, MONTH, YEAR, PARKNAME and VISITORS. The result of code below would return the top 3 number visitors by REGION, YEAR and MONTH. proc means data=pg1.np_multiyr noprint;
var Visitors;
class Region Year;
ways 2;
output out=top3parks(drop=_freq_ _type_)
sum=TotalVisitors
idgroup(max(Visitors) out[3] (Visitors ParkName)=);
run; SAS output running the above code: By referring to the raw data below, 193,116 visitors is the data for Alaska in the 8th month of 2010. I am just wondering since the code only classify the VISITORS by REGION and YEAR, why would "MONTH" be considered when there is no MONTH variable in the code?
... View more