Hi all, my name is Tiana Stussie. I am currently completing my undergraduate research project. For my research project, I am focusing on the differences of the EITC between childless workers and households with children. For my sample, I am pulling data from 2019 Revised Supplemental Poverty Measure 2019 and I am using Stata 17.
Currently I am trying to find the average EITC received by single mother households by number of children (average EITC for households with 0,1,2,3 kids) as well as the average federal tax liability for single mother households. I am having difficulty because the EITC and federal tax liability are grouped by spm_id but are repeated for each individual observation. I am trying to find a way to not have these duplicates in my calculations for the average. I have included the variables I have been using below and the stata commands that I have tried.
Commands:
//Below are the commands that I used to create my sample. I wanted to focus on households that had a single parent who was female. So I chose the family type to be female reference person (4), the age of head of the household to be 18, and the marital status to be everything that excludes married.
gen single_pop = (spm_famtype==4 & spm_hage>=18 & spm_hmaritalstatus>3)
replace single_pop =. if spm_famtype==.
replace single_pop =. if spm_hage==.
replace single_pop =. if spm_hmaritalstatus==.
drop if single_pop == 0
//Below are the commands that I used to try to find the averages.
sort spm_id
by spm_id: egen unit_eitc = total(spm_eitc)
by spm_id: egen unit_eitc_avg = total(spm_eitc/_N)
by spm_id: egen unit_fedtax = total(spm_fedtaxbc)
by egen unit_fedtax_average = total(spm_fedtaxbc/_N)
Code:
* Example generated by -dataex-. For more info, type help dataex clear input double spm_id float(unit_eitc unit_eitc_avg) double spm_eitc float single_pop double(spm_hmaritalstatus spm_hage spm_famtype) 18001 0 0 0 1 5 65 4 18001 0 0 0 1 5 65 4 82001 0 0 0 1 7 72 4 82001 0 0 0 1 7 72 4 328001 0 0 0 1 7 37 4 328001 0 0 0 1 7 37 4 390001 0 0 0 1 5 49 4 390001 0 0 0 1 5 49 4 390001 0 0 0 1 5 49 4 393001 0 0 0 1 7 41 4 393001 0 0 0 1 7 41 4 411001 0 0 0 1 4 80 4 411001 0 0 0 1 4 80 4 630001 1058 529 529 1 7 45 4 630001 1058 529 529 1 7 45 4 690001 0 0 0 1 7 42 4 690001 0 0 0 1 7 42 4 764001 1916 958 958 1 7 19 4 764001 1916 958 958 1 7 19 4 840001 0 0 0 1 5 61 4 840001 0 0 0 1 5 61 4 937001 7296 1824 1824 1 6 35 4 937001 7296 1824 1824 1 6 35 4 937001 7296 1824 1824 1 6 35 4 937001 7296 1824 1824 1 6 35 4
This is my first time posting on statalist, so please let know if there is any additional information I can provide!
Comment