options nocenter ls=132 ps=82 nonumber; libname disk 'sasfiles'; /* This program creates merge91.ssd: 1) Cocatenates member files centering around 1991 and merges them by newid. Creates over65, under18 and marriage flags. Only flags are kept. 2) Cocatenates family files centering around 1991. 3) Merges the member and family files 4) calculates 1991 taxes and netinc, income net of federal and state income taxes and social security payroll tax 5) DROPS OBSERVATIONS WITH ZERO CBO WEIGHTS OR ADJWT Note that RENTS is income and RENT is expenditure */ data temp; set disk.memb901 disk.memb902 disk.memb903 disk.memb904 disk.memb911 disk.memb912 disk.memb913 disk.memb914 disk.memb921 disk.memb922 disk.memb923 disk.memb924; proc sort; by newid; run; data memb; set temp; by newid; retain number65 over65 under18 married; if first.newid then do; number65 = 0; over65 = 0; under18 = 0; married = 0; end; if age ge 65 then over65 = 1; if age ge 65 then number65 = number65+1; if age lt 18 then under18 = 1; if marital = "1" then married = 1; if last.newid then output; keep newid number65 over65 under18 married; run; proc sort; by newid; run; data fam; set disk.fam901 disk.fam902 disk.fam903 disk.fam904 disk.fam911 disk.fam912 disk.fam913 disk.fam914 disk.fam921 disk.fam922 disk.fam923 disk.fam924; totwt = totwt/12; adjwt = adjwt/12; proc sort; by newid; run; /* in addition to merging 1990 through 1992 data, taxes are calculated based on 1991 law */ data disk.merge91; merge fam memb; by newid; /* we assume that pensions are taxable to the same extent as they are in the SOI 74 percent of pensions were included in AGI in 1991 */ if adjwt gt 0; agi = wages+bus+farm+rents+div+int+unemp+ .74*pension-gvpremia-pnpremia-sepremia-give; agi = max(0,agi); excl = 25000 + 7000*married; /* if agi gt excl then agi = agi+.5*socsec; else do; if agi lt excl and agi+.5*socsec gt excl then agi = agi+(agi+.5*socsec-excl); end; */ exempt = 2350*famsize; zbr = 3400 + 850*min(2,number65); if famsize ge 2 then zbr = 5700 + 850*min(2,number65); medical = max(0.,drugs+orthopd+doctors+hospital+nurshome+helthins); mededuc = max(0.,medical-max(0.,.075*agi)); deduc = mededuc+statax+pproptax+othtax+charity+ohint+ohtax+charity; amtdeduc = deduc; if deduc lt zbr then do; amtdeduc = zbr; deduc = 0; mededuc = 0; end; taxinc = max(0.,agi-amtdeduc-exempt); topof15 = 20350; topof28 = 49300; if famsize ge 2 then topof15 = 34000; if famsize ge 2 then topof28 = 82150; ourtax = .15 *min(topof15,taxinc)+ .28 *min((topof28-topof15),max(0,taxinc-topof15))+ .31 *max(0,taxinc-topof28); eic = .; if agi lt 21250 and wages lt 21250 and famsize gt 1 and under18 eq 1 then do; eic = min(1235,.17*wages); limiter = max(agi,wages); if limiter gt 11250 then eic = eic*(1-(limiter-11250)/(10000)); ourtax = ourtax-eic; if eic = 0 then eic = .; end; cextax = fedtax; fedtax = ourtax; /* payroll and state taxes are imputed using a rough imputation algorithm */ ficabase = wages + max(0.,bus); if married eq 0 then do; fica = .0765*min(ficabase,53400); if ficabase gt 53400 then fica = fica+.0145*(ficabase-53400); end; if married eq 1 then do; fbase1 = .67*ficabase; fbase2 = .33*ficabase; fica1 = .0765*min(fbase1,53400); fica2 = .0765*min(fbase2,53400); if fbase1 gt 53400 then fica1 = fica1+.0145*(fbase1-53400); if fbase2 gt 53400 then fica2 = fica2+.0145*(fbase2-53400); fica = fica1+fica2; end; statbase = max(0,agi-zbr-exempt); statax = .05*statbase; /* net income is gross income net of federal, state and payroll taxes */ totax = fedtax+fica+statax; netinc = income-totax; drop topof15 topof28 limiter; title 'Dropped all zero ADJWT observations'; proc means n sum mean; weight adjwt; run;