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).

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

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.

  • $\begingroup$ 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)? $\endgroup$ – Yang Jan 28 '15 at 13:18
  • $\begingroup$ See my edit and the links provided. $\endgroup$ – Tim Jan 28 '15 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.