Random intercept vs. random slopes in 2LevelImpute

Welcome to the forum for Stat-JR users. Feel free to post your question about Stat-JR 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!

We will add further support to the Stat-JR website, such as FAQs and tutorials, as soon as it is available; the Stat-JR website can be found here: http://www.bristol.ac.uk/cmm/software/statjr/
shakespeare
Posts: 70
Joined: Thu Feb 14, 2013 11:12 pm

Re: Random intercept vs. random slopes in 2LevelImpute

Post by shakespeare »

So what other ways would you suggest for displaying the plots? I think there might be a way to do this in R, but I'm not that facile with that application. Anything else? Mlwin doesn't seem to recognize that type of file, but I could be doing something wrong. And is there an easy way of telling which plots match to which variable?
richardparker
Posts: 61
Joined: Fri Oct 23, 2009 1:49 pm

Re: Random intercept vs. random slopes in 2LevelImpute

Post by richardparker »

Hi - you will hopefully be able to open them in a browser: e.g. Internet Explorer has support for .svg from version 9 onwards: see http://caniuse.com/#feat=svg. Also, thinking on, you could try switching to compatibility view when using IE10: may help the initial problems you had rendering the plots (there's a note about this in Stat-JR FAQs).

Each plot is saved under the name of the parameter it corresponds to, and has the name of the parameter as a title to the plot too. For the MOI, the fixed effects (beta_0, beta_1, etc) can be cross-referenced with one of the other outputs (e.g. ResultsTable:Imputation has a column of variable names to the right). It's a little less tractable for the Imputation model, but can be related to the input string. E.g. in an example I have just run, I had three responses in the imputation model at level 1 (standlrtmiss, girlmiss, normexam), and one at level 2 (schgendmiss), each with only an intercept as an explanatory variable, as reflected in my input string as follows:

'yimp1': 'standlrtmiss,girlmiss,normexam', 'ximp1_0': 'cons', 'ximp1_1': 'cons', 'ximp1_2': 'cons', 'yimp2': 'schgendmiss', 'ximp2_0_1': 'cons', 'ximp2_0_0': 'cons'

Imputation_Model_beta1_0.svg refers to the intercept associated with the first response I chose at level 1 (standlrtmiss), Imputation_Model_beta1_1.svg refers to the intercept for the second response I chose at level 1 (girlmiss), and so on. For level 2, I have Imputation_Model_beta2_0.svg and Imputation_Model_beta2_1.svg: schgendmiss is an unordered response with 3 categories; Stat-JR has made the highest category (in terms of its numeric code) the reference category, and contrasts category 0 (Imputation_Model_beta2_0) and category 1 (Imputation_Model_beta2_1) against it.
shakespeare
Posts: 70
Joined: Thu Feb 14, 2013 11:12 pm

Re: Random intercept vs. random slopes in 2LevelImpute

Post by shakespeare »

Good news and bad news. When I tried to go to compatibility mode, TREE restarted and I lost the results pane, so I no longer have access to my output files. I guess I should have been on the tab displaying the graph before attempting this. I don't know how to get back to my files without rerunning my model (which took a couple of days). I'm not sure how to display the ResultsTable_Imputation, but I can see it in in the folder when I go to Explorer. It's not visible from IE. Is there some way to return TREE to your files once it restarts, and how can I now display the results table with the variable names?

Good news is I'm able to display .svg plots by opening them in IE. I need to make sure that I'm looking at the right plots. I'm interested in the imputations. Right now I'm looking at Imputation_model_beta1_0.svg. Is this one of the imputation plots? It's a bit odd in that the parameter plot and density plot are blank, so that makes me wonder if I'm looking at the right thing. There are other plots that are populated, e.g., Combined_beta_0, but I'm not sure that's for the imputation. I need some direction. Thx.
richardparker
Posts: 61
Joined: Fri Oct 23, 2009 1:49 pm

Re: Random intercept vs. random slopes in 2LevelImpute

Post by richardparker »

Hi - I'm sorry to hear you've lost the results pane; yes, safer to switch to compatibility mode on an occasion when you're starting Stat-JR afresh - apologies I didn't make that clearer. You should be able to recover all your outputs from your downloaded results, however: e.g. WordPad is a good choice to view the ResultsTable_Imputation file.

If you have more processors than requested imputed datasets, there won't be any chain to plot in the diagnostics, so that may be what you're observing. As mentioned in an earlier post (9 Dec, I think) even if you have requested more imputed datasets than you have processors on which to run them, chains will only run post-burnin (and thus be plotted in the diagnostics) for a length corresponding to your answer to the 'Number of iterations between imputations' question.
shakespeare
Posts: 70
Joined: Thu Feb 14, 2013 11:12 pm

Re: Random intercept vs. random slopes in 2LevelImpute

Post by shakespeare »

Yes, WordPad displays the ResultsTable_Imputation file. Thanks for the tip. Didn't realize it was a text file.

I remember your post from the 9th, but it was not clear to me. Here's why:

Current input string: {'want2': 'No', 'bin1_5': 'Binary', 'ximp1_0_2': 'sexrec:cat,quarterrec:cat,gestagecat:cat,steroids:cat,dischyearrec:cat,cons', 'ximp1_0_0': 'sexrec:cat,quarterrec:cat,gestagecat:cat,steroids:cat,dischyearrec:cat,cons', 'ximp1_0_1': 'sexrec:cat,quarterrec:cat,gestagecat:cat,steroids:cat,dischyearrec:cat,cons', 'bin1_3': 'Normal', 'bin1_2': 'Normal', 'bin1_1': 'Unordered', 'link': 'logit', 'iterations': '5000', 'bin1_4': 'Normal', 'ncatsracerec': '4', 'numlevs': 'Yes', 'MOIslope': 'No', 'condmarg': 'Yes', 'L2ID': 'site2', 'burnin': '5000', 'yimp1': 'racerec,tcodec,tcode2c,bwc,bncat', 'numimpute': '10', 'imputeevery': '5000', 'MOIlevel': '2 levels', 'ximp1_1': 'sexrec:cat,quarterrec:cat,gestagecat:cat,steroids:cat,dischyearrec:cat,cons', 'ximp1_3': 'sexrec:cat,quarterrec:cat,gestagecat:cat,steroids:cat,dischyearrec:cat,cons', 'ximp1_2': 'sexrec:cat,quarterrec:cat,gestagecat:cat,steroids:cat,dischyearrec:cat,cons', 'ximp1_4': 'sexrec:cat,quarterrec:cat,gestagecat:cat,steroids:cat,dischyearrec:cat,cons', 'MOIdist': 'Binary', 'y': 'died', 'x': 'sexrec:cat,racerec:cat,tcodec,tcode2c,bwc,bncat:cat,quarterrec:cat,gestagecat:cat,steroids:cat,dischyearrec:cat,cons'}

It seems like I've specified 5000 iterations between imputations, e.g., 'iterations': '5000'. I have 12 available processors. I presume one is reserved for the OS and I'm requesting 10 imputations. So I'm wondering how to evaluate the mixing properties of my imputations. Suggestions? Thx.
Post Reply