Hi all

First, let me say I am a 4th-year psychology student doing her Honours thesis, I am NOT a statistician so my knowledge of Stata is probably very basic compared to most users here! I need to create a new variable as follows:

existing var 1 - children under 5? yes/no where yes = 1, no = 2
existing var 2 - children under 16? yes/no where yes = 1, no = 2

new var - children between 5 and 16 years

I am looking at both gen and egen functions but I can't see a way to tell Stata that I want the new variable to include those who responded No/2 to existing var 1 and those who responded Yes/1 to existing var 2.

Can anyone help me out? I'm using Stata/MP 17.0

thank you!
Mel