Can someone please tell me why this is an invalid syntax and I can't label my age groups please?
gen agegroups = 0
replace agegroups = 06 if CAGE >=0 & CAGE <=6
replace agegroups = 12 if CAGE >=5 & CAGE <=12
replace agegroups = 18 if CAGE >=11 & CAGE <=18
replace agegroups = 24 if CAGE >=17 & CAGE <=24
replace agegroups = 30 if CAGE >=23 & CAGE <=30
replace agegroups = 36 if CAGE >=29 & CAGE <=37
label define agegroups 6 “0-6 months” 12 “7-12 months” 18 "13-18 months" 24 "19-24 months" "25-30 months 36 "31-36 months"
label values agegroups agegroups
tab age groups
Many thanks
Related Posts with Labelling groups
no convergence in asclogitHi all, I have a few questions about asclogit. I am currently working with some ride-hailing data. …
How to use factor variable i.year in XTSUR command?I have 3 questions regarding XTSUR 1: When I input something like XTSUR (y1 y2 y3 = x1 x2 i.year) It…
How to optimize stata code that it can run faster?I have the code below to deal with panel data (there are quite a bit missing variables in my dataset…
Multiple Imputation MIHi all , Background: I have a dataset with 698 participants. I'm interested in doing multivariate …
Dependent Double-Sorting 25 Portfolios Code: * Example generated by -dataex-. To install: ssc install dataex clear input float s_id str52 …
Subscribe to:
Post Comments (Atom)
0 Response to Labelling groups
Post a Comment