error with imputed data

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
ali482002
Posts: 39
Joined: Fri Jan 30, 2015 7:14 am

error with imputed data

Post 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
ChrisCharlton
Posts: 1384
Joined: Mon Oct 19, 2009 10:34 am

Re: error with imputed data

Post 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?
Post Reply