I have several observations (individuals) with each belong to a household (so each has a household ID). That means there are cases where there are 3 or 4 observations sharing the same household ID meaning that they belong to the same household. I also have the variable ‘age’. Now I want to generate another variable which will say something like =1 ‘the individual belongs to a household with an individual below 5yrs) and =0 ‘the individual belongs to a household where there are no individuals below 5yrs’. What command should I use? Thanks.
Related Posts with stata command
Results of Logistic RegressionHi there, I tried to run a logistic regression, but it seems that my results does not seem to be cor…
Problem with correcting a heteroskedasticity and serial correlation on panel data with fixed effectHello Statalists, I have a balanced panel data of 131 countries over 20 years with fixed effect (us…
Problem with count variable generationDear Statalist Users, Although I went through many related discussions and explanations about my qu…
How to write a while statement for the purpose detailed in the post?Dear all, I have two variables: seq1 and u. seq1 is a repeating sequence: 1,2,3,4,5 u is a random …
How to create a categorical variable from a list?Hello members, I would like to seek your suggestion please on how best I can create a categorical v…
Subscribe to:
Post Comments (Atom)
0 Response to stata command
Post a Comment