I created this macro. But, there is no "Qunt" in the data set "wage". I received SAS warning that: The variable Qunt in the DROP, or RENAME list has never been referenced. Any tips would be much appreciated. %macro quantile(var1=, var2=, var3=, var4=);
DATA wage; SET AVG_wage;
%IF compyr = '2007-08' and sex = '1' %THEN %DO;
%IF nocR3 = &var1 %then %do;
if realwages <&var2 then Qunt= 1; else if &var2 <realwages <&var3 then Qunt= 2; else if realwages >&var3 then Qunt= 3; else Qunt= .; %end;
%else %IF md_nocR3 = &var4 %then %do;
if realwages <&var2 then Qunt= 1; else if &var2 <realwages <&var3 then Qunt= 2; else if realwages >&var3 then Qunt= 3; else Qunt= .; %end;
%END;
keep sex compyr nocR3 Qunt;
RUN;
%mend quantile;
options symbolgen;
%quantile(var1='00', var2=47.5 , var3 =95.9);
%quantile(var4='11', var2=22.2, var3 =51.5;
%quantile(var4='12', var2=25.1 , var3 =42.8);
%quantile(var4='13', var2=23.2 , var3 =32.0);
... View more