Best fit line on predicted repeated measures lines in graphs

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: http://www.bristol.ac.uk/cmm/software/s ... port-faqs/
Post Reply
stephan87
Posts: 9
Joined: Sun May 11, 2014 8:06 am

Best fit line on predicted repeated measures lines in graphs

Post by stephan87 »

Hi all

So I have connected prediction lines for repeated measures (longitudinal) data (persons) and managed to graph these nicely. However, I was looking for a best fit line option for all these lines. This exists in Stata's xtline function, which I could use; however, Stata insists on colouring each of my panels in separate colours which make my head explode. (I've tried all options in Stata, only way is to create a for loop which I don't have time to experiment with now).

My best attempt was:
Request (additional) fixed effects-only predictions
Unreplicate these by the x variable (age) *However, age is continuous in my data set so does not result in fewer rows
I overlayed another plot of these merged fixed effects on age grouped by a constant, on top of my existing level-2 random-effects predicted lines
Needless to say if you think about it; didn't work...
Stephan
ChrisCharlton
Posts: 1384
Joined: Mon Oct 19, 2009 10:34 am

Re: Best fit line on predicted repeated measures lines in gr

Post by ChrisCharlton »

Would it be possible for you to post pictures of your graphs and equations so far to demonstrate what you are trying to do? Examples with data would also be useful if you are able to provide this.
stephan87
Posts: 9
Joined: Sun May 11, 2014 8:06 am

Re: Best fit line on predicted repeated measures lines in gr

Post by stephan87 »

Sorry, seems my emf pictures were discarded. Sorry about the unweildy graph size:
MLwiN predicted scores
MLwiN predicted scores
Predictions main.jpg (607.74 KiB) Viewed 4412 times
Actually, my question can be generalized to all predicted lines (not just repeated measures) when I think about it.
I should be more precise (and general) in my question: I want an overall best of fit line for all the lines connecting points, which in my case happens to be lines for individuals where the points are occasion measurements.
The equation is in it's most general form (however, I don't see how it would help):
Equation.jpg
Equation.jpg (14.22 KiB) Viewed 4412 times
Post Reply