Hi Bronwyn, 

to shorten equations, lets set t = years_form_baseline
a = age
g = group
s = sex

so your model is
Y_ij = b0 + b1 t_ij + b2 a_i + b3 g_i + b4 s_i + b5 t_ij a_i + b6 t_ij g_i + b7 
a_i g_i + b8 t_ij a_i g_i
(as a fist step, I would consider simplifying it, by dropping the age 
interactions). 

Anyway

for male (s_i =0) and controls (g_i = 0) this reduces to
Y_ij = b0 + b1 t_ij + b2 a_i + b5 t_ij a_i 
so b1 is the slope for male controls, controlling for age and the slope age 
interaction. (0 1 0….)

Now for female (s=1) patients (g=1) we get this:

Y_ij = b0 + b1 t_ij + b2 a_i + b3  + b4 + b5 t_ij a_i + b6 t_ij + b7 a_i + b8 
t_ij
       = (b0+b3+b4) + (b1 + b6 + b8 ) t_ij + (b2+b7) a_i + b5 t_ij a_i 
So the slope for female patients (controlling for age and age time interaction) 
would be
(b1 + b6 + b8)
0 1 0 0 0 0 1 0 1

The difference in slope between female patients and male controls would be
0 0 0 0 0 0 1 0 1 (or the negative of that depending which way you subtract). 
Similarly you can look at group differences (controlling for age gender and 
interactions). 

Always write out the full model to make sure you understand what you are doing. 

To complete the picture, here is the contrast for the slope of male patients
0 1 0 0 0 0 1 0 1 (it is the same as for female patients, because you don’t 
have a timeXgender interaction. So that is your patient slope )
Therefore the 
0 0 0 0 0 0 1 0 1  is the slope difference between the groups. 

I would recommend you talk to a local biostatistician, to make sure you are 
actually modelling what you want to model. And that you are interpreting the 
results correctly.  

Grüße, Martin

> On 06 Mar 2017, at 18:56, Bronwyn Overs <b.ov...@neura.edu.au> wrote:
> 
> Hi Martin,
> 
> Thank you for your response, that is much clearer. 
> 
> I am also a little confused about how to specify the exact contrasts we wish 
> to test and was hoping to get some advice. My design matrix X includes the 
> following columns:
> 1. Intercept
> 2. Years from baseline
> 3. Age at baseline
> 4. Group (patients labelled 1, controls 0)
> 5. Gender (females labelled 1, males 0)
> 6. Col 2 (years) * Col 3 (age)
> 7. Col 2 (years) * Col 4 (group)
> 8. Col 3 (age) * Col 4 (group)
> 9. Col 2 (years) * Col 3 (age) * Col 4 (group)
> 
> If I test the following contrast, is it giving me the effect of years across 
> all groups and genders, or just years for male controls:
> CM.C = [0 1 0 0 0 0 0 0 0]
> 
> Also, what contrast should I use to examine the effect of years in my patient 
> group irrespective of gender?
> 
> Kind regards,
> Bronwyn Overs
> Research Assistant
> 
> Neuroscience Research Australia
> Margarete Ainsworth Building
> Barker Street Randwick Sydney NSW 2031 Australia
> M 0411 308 769 T +61 2 9399 1883 F +61 2 9399 1265
> 
> neura.edu.au  <http://neura.edu.au/>
>  <https://twitter.com/neuraustralia> 
> <https://www.facebook.com/NeuroscienceResearchAustralia> 
> <http://www.neura.edu.au/help-research/subscribe>
>> On 4 Mar 2017, at 12:43 am, Martin Reuter <mreu...@nmr.mgh.harvard.edu 
>> <mailto:mreu...@nmr.mgh.harvard.edu>> wrote:
>> 
>> Hi Bronwyn, 
>> 
>> I think years-between-scans should be years-from-baseline-scans . You may 
>> need to compute that if what you have is really years between neighbouring 
>> scans.
>> 
>> 1. Usually people use intercept and maybe years-from-baseline as random 
>> effects. I would not include too many random effects, as it each adds a lot 
>> of free parameters and you need a lot of data to fit all that in a 
>> meaningful way. Which of your columns are random effects can be passed 
>> lme_fit_FS(X,[1 2],Y(:,1)+Y(:,2),ni);
>> for example has column 1 and 2 as random effects. 
>> 
>> 2. You can do a model comparison as described on our wiki 
>> https://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels 
>> <https://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels> 
>> 
>> You run the more complex model first (do the EM init and maybe RgGrow and 
>> RgW fit) and then the simple one (only the EMinit and  RgW fit) and do a 
>> likelihodd ratio test.  An example is on the above wiki.
>> 
>> Best ,Martin 
>> 
>> 
>> 
>> 
>> 
>>> On 27 Feb 2017, at 04:16, Bronwyn Overs <b.ov...@neura.edu.au 
>>> <mailto:b.ov...@neura.edu.au>> wrote:
>>> 
>>> Dear mailing list,
>>> 
>>> I am trying to run a LME model using the matlab tools, but I’m unsure how 
>>> to specify the model we wish to run. We have a qdec file that contains the 
>>> following columns:
>>> fsid, fsid-abse, years between scans, age at baseline, gender, group
>>> 
>>> We want to specify a model where we can examine four interaction terms 
>>> (years*age, years*group, age*group, years*age*group), as well as random 
>>> effects for the intercept, years and age. My questions are:
>>> 1. How do we specify a model that will include the random effects we want?
>>> 2. How do we compare our full model (3 random effects) with a model 
>>> excluding the random effect for age?
>>> 
>>> Kind regards,
>>> Bronwyn Overs
>>> Research Assistant
>>> 
>>> Neuroscience Research Australia
>>> Margarete Ainsworth Building
>>> Barker Street Randwick Sydney NSW 2031 Australia
>>> M 0411 308 769 T +61 2 9399 1883 F +61 2 9399 1265
>>> 
>>> neura.edu.au  <http://neura.edu.au/>
>>>  <https://twitter.com/neuraustralia> 
>>> <https://www.facebook.com/NeuroscienceResearchAustralia> 
>>> <http://www.neura.edu.au/help-research/subscribe>
>>> _______________________________________________
>>> Freesurfer mailing list
>>> Freesurfer@nmr.mgh.harvard.edu <mailto:Freesurfer@nmr.mgh.harvard.edu>
>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer 
>>> <https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer>
>> _______________________________________________
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu <mailto:Freesurfer@nmr.mgh.harvard.edu>
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer 
>> <https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer>
>> 
>> 
>> The information in this e-mail is intended only for the person to whom it is
>> addressed. If you believe this e-mail was sent to you in error and the e-mail
>> contains patient information, please contact the Partners Compliance 
>> HelpLine at
>> http://www.partners.org/complianceline 
>> <http://www.partners.org/complianceline> . If the e-mail was sent to you in 
>> error
>> but does not contain patient information, please contact the sender and 
>> properly
>> dispose of the e-mail.
> 
> _______________________________________________
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Reply via email to