Hi Listers,
I am interested in conducting a multiple imputation on a dataset looking at healthy behaviours. I would like to impute missing data using mi impute chained.
In one question, they were asked if they smoked (smoking). If they answered yes, they were also asked how many cigarettes per day (CPD). For the latter variable, I therefore have some missing data but for some participants this information is missing as they do not smoke so I would not want to impute any value for them.
I explored the possibility of using the conditional sub-command so that
mi impute chained (pmm, knn(3) conditional (if smoking==1)) cpd ///
(logit, augment) smoking... = regular variables, add(50)
However, I get an error message saying 'No complete observations outside conditional sample; imputation variable contains only missing values outside the conditional sample'.
This is true but is there any workaround to deal with it either using the -conditional()- option or a different approach?
Thanks in advance!
I am interested in conducting a multiple imputation on a dataset looking at healthy behaviours. I would like to impute missing data using mi impute chained.
In one question, they were asked if they smoked (smoking). If they answered yes, they were also asked how many cigarettes per day (CPD). For the latter variable, I therefore have some missing data but for some participants this information is missing as they do not smoke so I would not want to impute any value for them.
I explored the possibility of using the conditional sub-command so that
mi impute chained (pmm, knn(3) conditional (if smoking==1)) cpd ///
(logit, augment) smoking... = regular variables, add(50)
However, I get an error message saying 'No complete observations outside conditional sample; imputation variable contains only missing values outside the conditional sample'.
This is true but is there any workaround to deal with it either using the -conditional()- option or a different approach?
Thanks in advance!
Comment