[R] R: Re: Differences in output of lme() when introducing interactions

angelo.arcadi at virgilio.it angelo.arcadi at virgilio.it
Wed Jul 22 16:05:02 CEST 2015


Dear Terry,
I am very grateful to you for such a detailed and helpful answer.
Following your recommendation then I will skip the method presented at http://www.ats.ucla.edu/stat/r/faq/type3.htm

So far, based on my understanding of R I arrived to the conclusion that the correct way to see if there is
a correlation between my dependent variable (spectral centroid of a sound) and weight, height, and interaction
between weight and height of participants asked to create those sounds (in a repeated measure design) is:


lme_centroid <- lme(Centroid ~ Weight*Height*Shoe_Size, data = My_data, random = ~1 | Subject)

anova.lme(lme_centroid,type = "marginal")


Can anyone please confirm me that those formulas are actually correct and give the significant or
non significant p-values for the main effects and their interactions? I would prefer to use lme(), not lmer().

I am making the assumption of course that the model I am using (Centroid ~ Weight*Height*Shoe_Size) is 
the best fit for my data.

Thanks in advance

Angelo




----Messaggio originale----
Da: therneau at mayo.edu
Data: 22-lug-2015 15.15
A: <r-help at r-project.org>, <angelo.arcadi at virgilio.it>
Ogg: Re:  Differences in output of lme() when introducing interactions

"Type III" is a peculiarity of SAS, which has taken root in the world.  There are 3 main 
questions wrt to it:

1. How to compute it (outside of SAS).  There is a trick using contr.treatment coding that 
works if the design has no missing factor combinations, your post has a link to such a 
description.  The SAS documentation is very obtuse, thus almost no one knows how to 
compute the general case.

2. What is it?  It is a population average.  The predicted average treatment effect in a 
balanced population-- one where all the factor combinations appeared the same number of 
times.  One way to compute 'type 3' is to create such a data set, get all the predicted 
values, and then take the average prediction for treatment A, average for treatment B, 
average for C, ...  and test "are these averages the same".   The algorithm of #1 above 
leads to another explanation which is a false trail, in my opinion.

3. Should you ever use it?  No.  There is a very strong inverse correlation between 
"understand what it really is" and "recommend its use".   Stephen Senn has written very 
intellgently on the issues.

Terry Therneau


On 07/22/2015 05:00 AM, r-help-request at r-project.org wrote:
> Dear Michael,
> thanks a lot. I am studying the marginality and I came across to this post:
>
> http://www.ats.ucla.edu/stat/r/faq/type3.htm
>
> Do you think that the procedure there described is the right one to solve my problem?
>
> Would you have any other online resources to suggest especially dealing with R?
>
> My department does not have a statician, so I have to find a solution with my own capacities.
>
> Thanks in advance
>
> Angelo



   
	[[alternative HTML version deleted]]



More information about the R-help mailing list