data QUEBEC;
set QUEBEC;
if wagesp<=30004 then f_tax=0.17*wagesp; /*federal tax*/
if 30004<wagesp<=60009 then f_tax=0.25*(wagesp-30004)+5101;
if wagesp>60009 then f_tax=0.29*(wagesp-60009)+12602;
data QUEBEC;
set QUEBEC; /*federal tax credits*/
f1=7231; /*basic amount*/
f2=(wagesp-3500)*0.039; /*CPP/QPP contribution*/
if f2<0 then f2=0;
if f2>1329.9 then f2=1329.9;
f3=wagesp*0.024; /*UI/EI contributions*/
if f3<0 then f3=0;
if f3>936 then f3=936;
f_credits=(f1+f2+f3)*0.17;
data QUEBEC;
set QUEBEC;
if wagesp<=26000 then p_tax=0.19*wagesp; /*provincial tax*/
if 26000<wagesp<=52000 then p_tax=0.225*(wagesp-26000)+4940;
if wagesp>52000 then p_tax=0.25*(wagesp-52000)+10790;
data QUEBEC;
set QUEBEC; /*provincial tax credits*/
p1=5900+2515; /*basic exemption*/
p2=(wagesp-3500)*0.039; /*CPP/QPP contribution*/
if p2<0 then p2=0;
if p2>1329.9 then p2=1329.9;
p3=wagesp*0.024; /*UI/EI contributions*/
if p3<0 then p3=0;
if p3>936 then p3=936;
p_credits=(p1+p2+p3)*0.22;
data BA;
set BA;
wageperhour=(wagesp-1818-f_tax+f_credits-p_tax+p_credits)/(hrswkp*wkswkp);
run;
proc reg data=BA;
model wageperhour=exp exp2 exp3 exp4;
run;
data PG;
set PG;
wageperhour=(wagesp-2147-f_tax+f_credits-p_tax+p_credits)/(hrswkp*wkswkp);
run;
proc reg data=PG;
model wageperhour=exp exp2 exp3 exp4;
run;