Hello statalist,
I have a dataset that includes parasite data. There are two variables of interest, the infection [1 or 0] (binary) and and intensity (continuous). Intensity data is only available if a person is infected (i.e., has a 1 for the infection variable). For the purpose of this post, let's say the infection variable is asc_bin and the intensity variable is asc_num.
I have 1010 participants, of which 962 provided a specimen to assess parasites. Of those who provided a specimen, 179 are infected. I need to impute both asc_bin and asc_num for the 48 participants with missing data. I believe the best way to do this would be to impute using negative binomial regression.
Steps:
1) Recode the continuous variable of asc_num to 0 for uninfected individuals (i.e., asc_bin==0), thereby all 962 observed participants have a value for asc_num. [successful]
2) Run a negative binomial regression with complete baseline variables (group, age, education, school, district) [successful]
3) Run the following MI code:
mi set wide
mi register imputed asc_num
mi register regular group, age, education, school, district
mi impute nbreg asc_num group, age, education, school, district, add(20) rseed(11) noisily [unsuccessful]
Error: asc_num: missing imputed values produced
This may occur when imputation variables are used as
independent variables or when independent variables
contain missing values. You can specify option force if
you wish to proceed anyway.
4) Using the force option does not impute any observations.
Question: Is there a work around for this? I am not understanding because all my independent variables (i.e., group, age, education, school, district) have no missing values.
Thanks,
Layla Sarah
I have a dataset that includes parasite data. There are two variables of interest, the infection [1 or 0] (binary) and and intensity (continuous). Intensity data is only available if a person is infected (i.e., has a 1 for the infection variable). For the purpose of this post, let's say the infection variable is asc_bin and the intensity variable is asc_num.
I have 1010 participants, of which 962 provided a specimen to assess parasites. Of those who provided a specimen, 179 are infected. I need to impute both asc_bin and asc_num for the 48 participants with missing data. I believe the best way to do this would be to impute using negative binomial regression.
Steps:
1) Recode the continuous variable of asc_num to 0 for uninfected individuals (i.e., asc_bin==0), thereby all 962 observed participants have a value for asc_num. [successful]
2) Run a negative binomial regression with complete baseline variables (group, age, education, school, district) [successful]
3) Run the following MI code:
mi set wide
mi register imputed asc_num
mi register regular group, age, education, school, district
mi impute nbreg asc_num group, age, education, school, district, add(20) rseed(11) noisily [unsuccessful]
Error: asc_num: missing imputed values produced
This may occur when imputation variables are used as
independent variables or when independent variables
contain missing values. You can specify option force if
you wish to proceed anyway.
4) Using the force option does not impute any observations.
Question: Is there a work around for this? I am not understanding because all my independent variables (i.e., group, age, education, school, district) have no missing values.
Thanks,
Layla Sarah
Comment