Strange predicted values

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

Remember to check out our extensive software FAQs which may answer your question: ... port-faqs/
Post Reply
Posts: 1
Joined: Thu Dec 10, 2020 5:44 pm

Strange predicted values

Post by thvdnhee »


I'm currently taking an intro to multilevel modelling class in my university and I'm having trouble making sense of some off my graphs.

The model is trying to explain the influence of age, GDP per capita in ppp (country level variable), gender (dummy variable on individual level), gender*age and GDP per capita in ppp*age on responsibility at work (a scale variable I made through factor analysis). It's a random slope model where all the variables are standardized and the slope is allowed to vary from country to country based on age.

When I'm making a graph of the predicted values of the model on age I'm getting weird lines.

I do get a desired graph when I remove the variables Gender and Gender*age (graph mentioned below). I would love to keep these variables in my model though since de -2log likelihood is much lower when they are added to the model. How can I make my prediction a straight line instead of the above mentioned chaos? Or can the above mentioned graph be reported in a paper?

Posts: 1285
Joined: Mon Oct 19, 2009 10:34 am

Re: Strange predicted values

Post by ChrisCharlton »

It looks like each line of your graph contains predictions for both genders, in a similar way to how the line on page 57 of the MLwiN user's guide ( ... al-web.pdf) contains predictions for all of the different schools. I think that the workaround for this would be to either change your grouping variable to one that contains a different code for each combination of group and gender, or to use the gender variable for the "row code" or "column code" option so that each gender is plotted on a different graph.
Post Reply