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
T-Test between two varibles with dummy conditionHey, I woul like to know how I could do the t-test between 2 variables if I calculated the mean with…
Combining locals that contain whitespaceI have a series of locals of the form: Code: local list1 "June 2004" local list2 "July 2004" …
Odds Ratios instead of Coefficients using teffects?I'm running a series of models using teffects psmatch, teffects ra, and teffects ipw and comparing a…
Beginner questionHi people, I'm a total noobs to Stata and have spent two hours trying ot figure this dumb thing out…
Importing CSV file with surrounding single quotesI'm attempting to import data in a CSV file, where almost all variable values are surrounded by sing…
Subscribe to:
Post Comments (Atom)
0 Response to stata command
Post a Comment