Hi Dear All
I imputed missing values of my data using multiple imputation method. When I run a multinomial model with runmlwin, I get the following error message:" ... cases with missing values for one or more variables included in the model must be dropped...” I checked imputed variables but, there was no any missing value!
My command was;
xi: mi est, cmdok: runmlwin Response Var. cons X1 i.X2 , level2( level2ID : cons) level1(level1ID:) discrete(dist (multinomial) link(mlogit) denom (cons) basecategory(1)) nopause
Why this happen?
Would you please give me some advices?
Thanks
error with imputed data
-
- Posts: 1384
- Joined: Mon Oct 19, 2009 10:34 am
Re: error with imputed data
This error is coming from the following section of code:
which is simply looping through the variables that will be sent to MLwiN looking for missing values. If you issue the command:
prior to running your model you should be able to determine which variable it is having trouble with from the output. Is it possible that you have a missing value in one of the variables that you aren't imputing but have in the model?
Code: Select all
local data_has_missing_values = 0
foreach var of local allvarsformlwin {
if "`var'" ~= "bcons" {
quietly count if missing(`var')
if r(N) > 0 {
if "`mtype'" == "multinomial" {
display as error "For multinomial response models (i.e. ordered and unordered categorical responses), the data must be manually listwise deleted (i.e. cases with missing values for one or more variables included in the model must be dropped) prior to calling runmlwin."
exit 198
}
local data_has_missing_values = 1
}
}
}
Code: Select all
set trace on