From | David Kantor <[email protected]> |
To | [email protected] |
Subject | Re: st: calculating group means |
Date | Thu, 25 Jul 2002 18:39:53 -0400 |
At 04:40 PM 7/25/2002 -0400, Gayatri Koolwal. wrote:
I have a data set of individuals who belong to different households, each with a value of a variable x2. For each household, I would like to create a new variable that is the mean of x2 for the individuals in that household. Would anyone be able to help me with the procedure for this? Do I need to collapse the data set first somehow?As Marcela Perticara indicated, you can use egen ... mean ... by(householdid)
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |