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
Unzipping fileHello. I am having trouble unzipping a file with Stata. Please see picture attached. …
Help with xtreg, splines and trends?Hi all, since my last post I have read the FAQs and so this should be a better post; Now, I am doin…
Time variable issue when trying a difference in difference approachGood day I want to perform a difference in difference regression defined as Code: mi estimate, e…
by id: replace var1[1] = max(var1), error "weights not allowed"Dear community I have the following types of panel data: The actual data is huge, so ask questions t…
ASDOC: Dropping base level of factor variablesDear all users pf Statalist I do not find option of the command of asdoc to drop base level of fact…
Subscribe to:
Post Comments (Atom)
0 Response to Labelling groups
Post a Comment