Dear Statalist,
I’m using a dataset consisting of 5 variables - a household identifier, an identifier of the person within a household, a variable that shows if the person is a child or an adult, a variable that displays the ethnic group of the person and a variable that shows total income of that person. At first, i created a new variable displaying the total income of a household, divided by the number of people in that household. Since there are many children included in the set, I would like to ‘weigh’ these observations. Specifically, I would like to create a new variable that displays the income of a household divided by the number of people; but when dividing, I want the adults to be taken in account at a value of 1 and the children at a value of 0.5.
Could someone tell me how this can be done in Stata (V16.1)?
Thanks in advance!
Related Posts with Give weights to observations
Bar graph with multiple variables overlayingHello, I am wondering if it is possible to create a figure like this using stata. I have two variab…
opening v11 do files on same PC with new v17I checked forums and Google. Could not find the right answer. In short, I had Stata 11 on wife's PC …
how to create a cross-tabulations, dummy variables and regression with wide dataCan someone help me with a syntax to use; on how to run cross tabulations, create dummy variables an…
Reshape with two types of ID variablesHi all, Is there a way to reshape by individual ID with another ID (household ID) as a variable, as …
Moving Average in Time SeriesHi All, I want to calculate the backward 12-month moving average of bse_monthly_market_volatility. …
Subscribe to:
Post Comments (Atom)
0 Response to Give weights to observations
Post a Comment