Dear Statalisters,
I have a dataset including age as groups after the age of 20; like 20-24, 25-29.
However, I can see the age of those who are younger than 20.
My problem arises when I want to generate a newd ummy variable for this age groups.
I use the command below:
. gen agegroup=1 if age<18
and I get this error message:
type mismatch
r(109)
Age is a string variable and I cannot format it. Any help will be appreciated. Thank you!
I have a dataset including age as groups after the age of 20; like 20-24, 25-29.
However, I can see the age of those who are younger than 20.
My problem arises when I want to generate a newd ummy variable for this age groups.
I use the command below:
. gen agegroup=1 if age<18
and I get this error message:
type mismatch
r(109)
Age is a string variable and I cannot format it. Any help will be appreciated. Thank you!
Comment