Page 1 of 1

Realcom start-up problem

Posted: Thu Mar 16, 2017 4:22 pm
by kellehek

I have encountered a problem that has stumped my IT advisers. I have been given full admin rights to all folders but we keep getting the same errors.

When trying to run the imputation I get the following error messages after pressing Start run MCMC:

Error using wishrndhg (line 35)
Degrees of freedom must be a positive scalar.

Error in samplel2rand (line 56)

Error in mcmcdriver (line 1099)

Error in gui_2levmixresp>pushbutton16_RunMCMC_Callback (line 264)

Error in gui_mainfcn (line 96)

Error in gui_2levmixresp (line 46)

Error in @<hObject,eventdata>gui_2levmixresp<'pushbutton16_RunMCMC_Callback'hObject,eventdata,guidata(hObject))

Error while evaluating uicontrol Callback

Any help would be gratefully recieved,

Kind regards,


Re: Realcom start-up problem

Posted: Thu Mar 16, 2017 5:34 pm
by ChrisCharlton
This could be a problem with your data or model, can you provide more details?

Re: Realcom start-up problem

Posted: Fri Mar 17, 2017 9:18 am
by kellehek
Dear Chris,

This is my code:
**Generate dummy variables and constant
gen cons=1
recode bl_ch_gender (1=0) (2=1), gen (bl_dummy_gender)
ta course_completer, gen (completer)

**Sort by cluster
sort course_venue

**Generate files for REALCOM
realcomImpute bl_bmiz m.merged_eth5 bl_imd2015_score m.bl_puberty bl_fatpcz eoc_fatpcz fu_fatpcz ///
bl_waistz bl_ch_hgt eoc_ch_hgt eoc_waistz fu_bmiz fu_waistz bl_merged_mvpa eoc_merged_mvpa fu_merged_mvpa m.eoc_puberty ///
m.fu_puberty completer1 completer2 completer3 bl_ch_age2 bl_ch_gender using "temp.dat", numresponses(18) cons(cons) level2id(course_venue) replace

bl_bmiz = continuous
m.merged_eth5 = 5 category ethnicity
bl_imd2015_score = continuous
m.bl_puberty = 3 category pubertal status
bl_fatpcz = continuous
eoc_fatpcz = continuous
fu_fatpcz = continuous
bl_waistz = continuous
bl_ch_hgt = continuous
eoc_ch_hgt = continuous
eoc_waistz = continuous
fu_bmiz = continuous
fu_waistz = continuous
bl_merged_mvpa = continuous
eoc_merged_mvpa = continuous
fu_merged_mvpa = continuous
m.eoc_puberty = 3 category pubertal status
m.fu_puberty = 3 category pubertal status
completer1 = dummy completion status variable attended =0, did not attend=1
completer2 = dummy completion status variable completed/did not attend =0, did not complete=1
completer3 = dummy completion status variable did not attend/did not complete =0, completed=1
bl_ch_age2 = continuous
bl_ch_gender = dummy gender variable male=0, female=1

I then open the temp.dat file in REALCOM, leave the 'MCMC estimation settings' as default, change the location of the output files under the 'Impute' button and press 'Start MCMC run'

Is there something obvious that I am doing wrong?

Kind regards,


Re: Realcom start-up problem

Posted: Fri Mar 17, 2017 4:36 pm
by ChrisCharlton
I showed this to Professor Goldstein, who developed the Realcom-Impute algorithm and he thought that this was mostly likely a data problem. If you were able to send him a reproducible example where this occurs (you can find the email address here: then he might be able to determine what is causing this.

Re: Realcom start-up problem

Posted: Tue Mar 21, 2017 3:46 pm
by kellehek
Thank you Chris.

I've narrowed it down to one variable that causes the software to stall. Putting the 5 group ethnicity variable into the STATA code to generate the file for REALCOM causes the imputation to stop. I've tried recoding it so the values begin at 0 and have checked the response type is correct (Un-ordered, ncat=5). Below is the summary of the data:

eth5 5 group ethnicity

type: numeric (float)
label: eth5

range: [0,4] units: 1
unique values: 5 missing .: 1/92

tabulation: Freq. Numeric Label
14 0 White
9 1 Black
44 2 BP
7 3 Indian
17 4 Mixed/Other ethnicities
1 .

I'm not sure what you mean by emailing over a reproducible example. Do you want me to send the relevant data and my dofile code to Professor Goldstein?



Re: Realcom start-up problem

Posted: Tue Mar 21, 2017 6:02 pm
by ChrisCharlton
Yes, the file to be loaded into Realcom-Impute would be what is needed. However as you appear to have only 92 records in your file it may just be that you don't have enough data to perform the imputation. You could try a single-level imputation and see whether you get further than that.