RHHTWLTH = RHHTHEQ + RHHVEHCL + RHHBEQ + RHHINTBK + RHHINTOT + RHHSTK + RHHORE + RHHOTAST + RHHIRA+RHHTHRIF ********************************************************************** ** Checking that sample unit and person ids are unique identifiers duplicates report id addid pnum ** This 'should' be a unique id, but there are 10 duplicate records of 50,662 that are not. ** Adding either entry or pinx creates a unique id describe pinx entry duplicates report id addid pnum entry assert `r(unique_value)'==`r(N)' duplicates report id addid pnum pinx assert `r(unique_value)'==`r(N)' duplicates tag id addid pnum, gen(dup) list id addid pnum entry pinx if dup ** Note that a sample unit may contain multiple households identified by addid ********************************************************************** ** Total Wealth describe thhtwlth hh_theq hh_vehcl hh_beq thhintbk thhintot rhhstk thhore thhotast thhira thhthrif ** wealth needs to be a double to preserve precision gen double wealth = hh_theq+hh_vehcl+hh_beq+thhintbk+thhintot+rhhstk +thhore+thhotast+thhira+thhthrif assert thhtwlth == wealth ********************************************************************** ** Home Equity describe hh_theq tm8598 tm8630 hh_mortg gen home = (tm8598+tm8630)-hh_mortg assert hh_theq == home ********************************************************************** ** Vehicle Equity describe hh_vehcl tmcarvl1 tm8760 tmcarvl2 tm8761 tmcarvl3 tm8762 tm8788 tm8796 tm8790 tm8798 ** This is the formula given by Census; however, hh_vehcl appears to have omitted tm8761, the amount owed on the vehicle gen vehicle = (tmcarvl1-tm8760)+(tmcarvl2-tm8761)+(tmcarvl3-tm8762)+(tm8788-tm8796)+(tm8790-tm8798) ** Census numbers appear off by $2 ** NOTE: This formula replicates hh_vehcl, though tm8761, I think, should have been subtracted from tmcarvl2 gen vehicle_no_tm8761 = (tmcarvl1-tm8760)+(tmcarvl2)+(tmcarvl3-tm8762)+(tm8788-tm8796)+(tm8790-tm8798) assert abs(hh_vehcl-vehicle_no_tm8761) <=2 ** Skipping this test due to tm8761 discrepancy *assert abs(hh_vehcl-vehicle)>-2 & abs(hh_vehcl-vehicle)<=0 ** NOTE: tmcarvl* looks consistent with 2004t3's tcarval* ** it affects these records: sum tm8761 if tm8761!=0 **list id addid pnum *veh* tmcarvl1 tm8760 tmcarvl2 tm8761 tmcarvl3 tm8762 tm8788 tm8796 tm8790 tm8798 in 1/500 , nol *list id addid pnum *veh* tmcarvl1 tm8760 tmcarvl2 tm8761 tmcarvl3 tm8762 tm8788 tm8796 tm8790 tm8798 if vdiff>0, nol ********************************************************************** ** Business Equity describe hh_beq evbow1 tvbva1 tvbde1 evbow1 tvbva1 tvbde1 ** The value of all the person's businesses in the household is applied to the household ** So, calculating person's business equity first, then applying the sum of all person's to the household gen p_business = (evbow1/100*(tvbva1-tvbde1))+(evbow2/100*(tvbva2-tvbde2)) bysort id addid: egen business=sum(p_business) ** Truncating to the integer value works a bit better than rounding replace business=int(business) ** Checking that calculated household business equity is within $1 of Census' assert abs(hh_beq-business)>-1 & abs(hh_beq-business)<=1 ********************************************************************** ** Bank Interest ** Again, the sum of each person's wealth is applied to the household describe thhintbk tiajta tiaita gen p_bank_int = tiajta+tiaita bysort id addid: egen bank_int=sum(p_bank_int) assert thhintbk == bank_int ********************************************************************** ** Other Interest ** The sum of each person's wealth is applied to the household describe thhintot timja timia gen p_oth_int = timja+timia bysort id addid: egen oth_int=sum(p_oth_int) assert thhintot == oth_int ********************************************************************** ** Stocks ** The sum of each person's wealth is applied to the household describe rhhstk esmjv esmjmav esmiv emsimav gen p_stock = (esmjv-esmjmav)+(esmiv-esmimav) bysort id addid: egen stock=sum(p_stock) assert rhhstk == stock ********************************************************************** ** Other real estate - Not home ** The sum of each person's wealth is applied to the household ** tothreva: All persons in HH get the reference person's response duplicated to their record ** trtsha: real estate jointly owned with other than spouse ** trjmv: joint, non-residence ASKED OF ONLY ONE SPOUSE. RESPONSE IS DIVIDED BY 2, AND THE DIVIDED AMOUNT IS COPIED TO BOTH SPOUSES RECORDS. ** trimv: owned in own name describe thhore tothreva trtsha trjmv trjpri trimv tripri ** trtsha, trimv, and trjmv apply to the whole hh, so hh-wise variables that are cum sums are needed bysort id addid: egen h_trt=sum(trtsha) bysort id addid: egen h_trj=sum(trjmv-trjpri) bysort id addid: egen h_tri=sum(trimv-tripri) gen oreal = tothreva+h_trt+h_trj+h_tri sort id addid pnum *list id addid pnum thhore *real* tothreva trtsha trjmv trjpri trimv tripri if id=="066925123035" , nol assert thhore == oreal ********************************************************************** ** Other assets ** The sum of each person's wealth is applied to the household describe thhotast tmjp tmip eoaeq ealowa talsbv taljcha talicha gen p_oth_ass = tmjp+tmip+eoaeq+ealowa+talsbv+taljcha+talicha bysort id addid: egen oth_ass=sum(p_oth_ass) assert thhotast == oth_ass list id addid pnum thhotast *ass tmjp tmip eoaeq ealowa talsbv taljcha talicha if thhotast!=oth_ass , nol list id addid pnum thhotast *ass tmjp tmip eoaeq ealowa talsbv taljcha talicha if id=="077344437402" , nol list id addid pnum thhotast *ass tmjp tmip eoaeq ealowa talsbv taljcha talicha if id=="104344074647" , nol ********************************************************************** ** IRA and KEOGH ** The sum of each person's wealth is applied to the household describe thhira talrb talkb gen p_ira = talrb+talkb bysort id addid: egen ira=sum(p_ira) assert thhira == ira ********************************************************************** ** 401K and Thrift ** The sum of each person's wealth is applied to the household describe thhthrif taltb bysort id addid: egen thrift=sum(taltb) assert thhthrif == thrift ********************************************************************** 1993 t4 & t7 asset modules: tm8666 real estate ? (tm8788-tm8796)+(tm8790-tm8798) vehicle business ownership does not seem to be asked 1993 t7 ONLY: hh_twlth = hh_theq + hh_vehcl + hh_beq + hh_intbk + hh_intot + hh_stk + hh_ore + hh_otast + hh_ira Note: the 401K/Thrift savings account question does not seem to be asked