x cd /pub/data/acspums/Tools; %let pgm=hincp_and_pincp; filename pgm "&pgm..sas" ; *---Look at vlues for hh and personal income figures in the pums data. Per q from Kenneth Darga re why tables B19025 and b19313 differ by almost 4 pct. ----; libname acspums '/pub/data/acspums' access=readonly; /* =======================Begin comment================ proc means sum data=acspums.ushrecs05(keep=hincp wgtp); weight wgtp; var hincp; format hincp dollar16.; run; *---The answer was 6.8520198E12---; proc means sum data=acspums.usprecs05(keep=pincp pwgtp); weight pwgtp; var pincp; format pincp dollar16.; run; *---The answer was 7.1207255E12 ---; ======================End comment================== */ *---Look at differences in household income as reported on hrecs dataset vs summing the person record income---; *--here we just use mo data. It will serve as an example--; data income_diffs; merge acspums.mohrecs05(in=inh) acspums.moprecs05(in=inp); by serialno; if inp; if first.serialno then Sum_pincp=pincp; else Sum_pincp + pincp; if last.serialno and Sum_pincp ne hincp then do; pinc_diff=hincp-Sum_pincp; if hincp ne 0 then PctPinc_diff=100*Pinc_diff/hincp; format pctPinc_diff 5.1; output; end; keep serialno hincp Sum_pincp pinc_diff pctPinc_diff; format hincp Sum_pincp dollar9.; run; proc univariate ; run; proc print data=income_diffs(obs=500); run;