Page 1 of 1

unordered categories

Posted: Fri Jun 05, 2015 1:35 am
by withus92
I want to impute race variable (unordered categories).

c_race Freq.
1 8,874
2 46,371
3 2,291
4 158
5 1,158
. 27,480
Total 86,332

Using STATA I ran this. I am showing partial independent variables:

xtmixed c_race im_mc_p_black im_mc_p_white im_mc_college || fips_code:
gen cons=1
sort fips_code
realcomImpute c_race im_mc_p_black im_mc_p_white im_mc_college using cmInputs.dat, replace numresponses(1) level2id(fips_code) cons(cons)

Using RealCom, I followed the practice example (please, see the attached document).
However, RealCom has not shown any results for 10 hours.

Please, let me know what to do.

I appreciate your help in advance.
Sarah

Re: unordered categories

Posted: Mon Jun 08, 2015 10:12 am
by ChrisCharlton
From the screenshots that you provided it appears that Realcom-Impute is giving the error message "max observed category > specified in NCATS for variable 1", which will prevent it from running any further. In order to allow it to run you need to ensure that your category codes are sequential integers up to the number of categories and that your missing value code matches that expected by Realcom-Impute.

Re: unordered categories

Posted: Tue Jun 09, 2015 1:59 am
by withus92
Thanks, Chris, for your answer.

Check the attached document. I think I am doing something wrong to impute a categorical variable.
Please, point out my mistakes.

Sarah

Re: unordered categories

Posted: Tue Jun 09, 2015 12:26 pm
by ChrisCharlton
You can specify that the variable is an unordered categorical response within Stata by using the m. prefix, for example:

Code: Select all

realcomImpute m.c_race im_mc_p_black im_mc_p_white im_mc_college using cmInputs.dat, replace numresponses(1) level2id(fips_code) cons(cons)
Realcom-Impute expects category numbers to be numbered starting from zero, so I suspect that if you just subtract one from your response variable it should work. If I remember correctly the renumbering is handled automatically if Realcom-Impute is aware that the variable is categorical when the data is first loaded.

Re: unordered categories

Posted: Thu Jun 11, 2015 9:56 pm
by withus92
Thanks, Chris.

YES, it worked well.

Appreciate your help.
Sarah