unordered categories

Welcome to the forum for REALCOM users. Feel free to post your question about REALCOM 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 REALCOM (Developing multilevel models for REAListically COMplex social science data) >> http://www.bristol.ac.uk/cmm/software/realcom/
Post Reply
withus92
Posts: 4
Joined: Thu May 28, 2015 11:42 pm

unordered categories

Post by withus92 » Fri Jun 05, 2015 1:35 am

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
Attachments
Question_RealCom.docx
(126.63 KiB) Downloaded 286 times

ChrisCharlton
Posts: 1090
Joined: Mon Oct 19, 2009 10:34 am

Re: unordered categories

Post by ChrisCharlton » Mon Jun 08, 2015 10:12 am

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.

withus92
Posts: 4
Joined: Thu May 28, 2015 11:42 pm

Re: unordered categories

Post by withus92 » Tue Jun 09, 2015 1:59 am

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
Attachments
Question_RealCom2.docx
(171.67 KiB) Downloaded 223 times

ChrisCharlton
Posts: 1090
Joined: Mon Oct 19, 2009 10:34 am

Re: unordered categories

Post by ChrisCharlton » Tue Jun 09, 2015 12:26 pm

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.

withus92
Posts: 4
Joined: Thu May 28, 2015 11:42 pm

Re: unordered categories

Post by withus92 » Thu Jun 11, 2015 9:56 pm

Thanks, Chris.

YES, it worked well.

Appreciate your help.
Sarah

Post Reply