Hello,
I want to create a variable that shows the % of increase in care by household. Below, you can see the data. For the simplicity I colored the households and I only showed the child level increase of help and parent level increase of help. What I want is to find parent level increased help divided by the total number of increased help within that household. I am not sure how to do this simple calculation within the household. That would be really nice if anyone can help me.
mergeid parent_level_increased_help) % increase help (variable I want to construct)
"AT-001881-02" 1 50%
"AT-001881-02" 1 50%
"AT-002965-02" 0 0%
"AT-002965-02" 0 .
"AT-002965-02" 0 .
"AT-002965-02" 0
"AT-020460-02" 0
"AT-020460-02" 0
"AT-020460-02" 0
"AT-020460-02" 0
"AT-020975-02" 0
"AT-020975-02" 0
"AT-020975-02" 0
"AT-034810-02" 1
"AT-034810-02" 1
"AT-044265-02" 0
"AT-044265-02" 0
"AT-046816-02" 2
"AT-046816-02" 2
Thanks in advance!
Related Posts with calculating percentages by household id
CMP convergence issue: getting coefficients but no SE, p-val etc.Hello, We are estimating a model with binary Y and binary X, using the CMP command. In our main ana…
subtracting year from a non-numeric variableDear all, i have a variable called E, which is the completed date of an acquisition (see screenshot…
Renaming columnsHi there, I was wondering if anybody could help. I have 200+ columns that could change when new dat…
New to STATA: separating numeric value variableHello, I am very new to STATA and am trying to learn by myself. However, I am stuck at this point: …
Insertto or appendtoDear Stata list, I want to generate an error list in a dta file on different conditions for data cl…
Subscribe to:
Post Comments (Atom)
0 Response to calculating percentages by household id
Post a Comment