Page 1 of 1

error with imputed data

Posted: Tue Apr 14, 2015 5:36 am
by ali482002
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

Re: error with imputed data

Posted: Thu Apr 23, 2015 9:33 am
by ChrisCharlton
This error is coming from the following section of code:

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
			}
		}
	}
which is simply looping through the variables that will be sent to MLwiN looking for missing values. If you issue the command:

Code: Select all

set trace on
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?