hi

I am trying to run a linear regression where some of the values in one of the independent variables is missing. I don't want to omit the missing variables but add a dummy variable for these instead. My variables are:

agegrp (no missing values)
IMD (some missing values)
reasonIMDmissing (0 if IMD is not missing and 1-4 for various reasons why missing)

the command I want is :

Code:
reg dependvar ib4.agegroup ib4.agegrp#c.IMD , b
This omits cases where IMD==. so in these cases I want a dummy variable for reasonIMDmissing instead. I've tried

Code:
reg dependvar ib4.agegroup 0.reasonIMDmissing#ib4.agegrp#c.IMD i(1/4).reasonIMDmissing , b
but this doesn't work. Can anyone help please?

Thanks
Rob