Hi Joshua,

Thank you again for your very-generous help. I think I could follow most of your explanations.

To give you some background about myself, I'm doing a PhD at the Institute of Sound Recording (IoSR) at the University of Surrey in the UK. As I have no statistics background, I've been teaching myself the topic using introductory statistics books such as Andy Field's "Discovering Statistics using SPSS". We do have a statistician on our campus, but I haven't visited him yet because I was told that I need to be very specific in the type of questions asked. Perhaps it's high time I saw him soon though.

I can clarify what the "A"," B", "C" and "D" factors are. Sorry for not doing this before. "A" and "B" are components of stimuli used in a listening test. "C" refers to a subject factor, while "D" refers to a repetition factor (i.e. multiple evaluations of the same stimulus by the same subject). I've treated "A" and "B" as fixed factors because I've assumed their scope extends only within the experiment. Regarding "C" and "D", these were treated as random factors because the former was assumed to generalise to the general population, while the latter was treated as a random factor because a paper which conducted a similar listening test did this. Finally, "Y" is a perceptual attribute with numerical ratings.

I've decided not to include the "D" factor in my model any more because it was shown to be not statistically significant in an ANOVA. In this case, is the following the correct R code ("A" and "B" are fixed factors, "C" is a random factor, 2- and 3-way interactions are modelled and the maximum log-likeliood is calculated)?

	lme(Y ~ (A + B)^3, data = myData, random = ~ 1 + B | C, method = "ML") 

I hope the "random = ~ 1 + B | C," syntax is correct here because I'm assuming that the subjects do not have independent observations and that the "B" components of the auditory stimuli are rated differently depending on the subject. Please let me know if otherwise. Originally I wanted to model 2- and 3-way interactions for all three factors, However, in the above model, I've only specified the interactions between "A" and "B". Are the A:C, B:C and A:B:C interactions handled automatically somehow?

Best regards,

Daisuke



--
View this message in context: http://r.789695.n4.nabble.com/Syntax-for-lme-function-to-model-random-factors-and-interactions-tp4630744p4631101.html
Sent from the R help mailing list archive at Nabble.com.
	[[alternative HTML version deleted]]

