2

Goal: comparing pitch (Hz) on three types of words

Dependent variable: Hz

Fixed predictor variable: word-type, points (measurements taken from five points on each token, to capture Hz change within a token), gender (females have higher Hz)

Random variable: repetitions, which are nested within items, which are nested within speakers. Each of 15 speaker produces 5 repetitions of 5 items of the same word-type.

My question is, how do I capture the nested nature of my three random variables, with mixed effect model using R? Naively I've tried (repetition|item|speaker), which obviously doesn't seem to work.

My full model, run with lme4 package, should like this:

lmer(hz ~ word_type + point + gender + (????), data=dataX)

The problem is that I am not sure I how should write my random variables (repetitions, items, and speakers).

Tim
  • 108,699
  • 20
  • 212
  • 390
Yang
  • 33
  • 5
  • What is your question? You ask if this kind of model is possible or about using a specific software to compute it..? – Tim Jan 28 '15 at 12:45
  • Hi Tim, I have updated my question. Hope it is clearer. I am sorry for my confusing original post.. – Yang Jan 28 '15 at 12:52

1 Answers1

2

You were close:

word_type + point + gender + (1|speaker/item/repetition)

This translates to: repetition nested in item, nested in speaker.

For learning more on lme4 formulas check the in press paper by Bates et al. (published here as a vignette for lme4), this answer or this one.

Tim
  • 108,699
  • 20
  • 212
  • 390
  • Many thanks. A follow-up question, does the order in which I list the random variables matter? (1|/item/speaker/repetition) different from (1|speaker/item/repetition)? – Yang Jan 28 '15 at 13:18
  • See my edit and the links provided. – Tim Jan 28 '15 at 13:28