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!
Related Posts with Multiple imputation and conditional()
In panel dataset where ID= household; method to understand if the same ID lived in the same housing unit over the entire time period?Hello everyone, sorry for the confusing title, I didn't manage to find a short and comprehensible w…
Loop code for Wide DataHi All, I'm struggling with the code for loops using wide data. I include a sample of the data and …
Lagging a variable 1 or more years from data on daily stock prices to use in OLS regressionI am trying to make an empirical study on the effect of dividend changes on future firm performance.…
Clubbing categories within variablesDear all, This is my data. Code: * Example generated by -dataex-. To install: ssc install dataex…
Predictor variables became not significant in fixed effect model.Hi. I am using Stata 15.1 and here is sample of my data. My main predictor variables are winpowersh …
Subscribe to:
Post Comments (Atom)
0 Response to Multiple imputation and conditional()
Post a Comment