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
Code:
reg dependvar ib4.agegroup 0.reasonIMDmissing#ib4.agegrp#c.IMD i(1/4).reasonIMDmissing , b
Thanks
Rob
0 Response to Interacting dummy variable for missing value in continuous variable
Post a Comment