1

Background: I am running an experiment with the following parameters.

  1. Design: 2-way Repeated Measures Design (as of right now there are NO between-group/grouping variables
  2. Dependent Variable: A Rating of the likelihood of being shocked on a scale 1-100 (continuous variable) which I will call SEperSECpersub 9sorry for the crap name)
  3. Independent Variable 1: A conditioned stimulus factor with 3 levels - CS-, CS+, CST - which I will call CS
  4. Independent Variable 2: A time variable representing the number of seconds after the onset of the CS from 1-12 which I will call sec. I am currently considering this a continuous variable.

My data looks as follows:

subject CS sec SEperSECpersub 1 S03V1 CS- 1 80.166667 2 S03V1 CS- 2 76.541667 3 S03V1 CS- 3 53.166667 4 S03V1 CS- 4 26.291667 5 S03V1 CS- 5 9.708333 6 S03V1 CS- 6 8.416667 7 S03V1 CS- 7 7.500000 8 S03V1 CS- 8 7.416667 9 S03V1 CS- 9 7.500000 10 S03V1 CS- 10 6.875000 11 S03V1 CS- 11 7.166667 12 S03V1 CS- 12 6.833333 13 S03V1 CS+ 1 52.791667 14 S03V1 CS+ 2 53.333333 15 S03V1 CS+ 3 68.791667

Problem: Normally I would perform a repeated measures ANOVA to get at the effects of both CS and sec on SEperSECpersub but the more I'm reading the more online resources are directing similar questions to perform mixed models, which is what I am attempting to do now with R's lmer function. As I am new to mixed modeling AND R I am running into some issues in understanding model logic as well as syntax and my main issue with online tutorials is that they are primarily for experiments with 2-level factors or one-way ANOVAs - I do not think I have found any tutorials for higher level designs like this as "technically" this analysis is looking at a 3x12 (ugh) RM ANOVA. Given these pieces of information I have a series of questions.

Main Question: How can I use linear mixed modeling with the lmer function to do what a 2-way RM ANOVA would do so that I can find the effects of each variable/interaction and, more specifically, find WHICH time points differ significantly between CSs (specifically between the CS+ and CST) without having to perform 12-follow-up t-tests with corrections?

My Steps/Thoughts so Far:

  1. While it may seem odd to include sec as a fixed effect, our hypotheses are about how the subjects time their responses and thus the difference between ratings during each second is important to us and will be considered a fixed variable. As I am used to ANOVAs I'm not sure how to structure the error term in this model. I assume there will be both a random intercept and slope for each both CS and sec. However, as time is inherent in experiencing any stimulus, each subject experiences each CS multiple times and each sec multiple times and each sec is experienced during each CS for each subject. Having read I believe this counts as 'completely crossed random effects'. Thus, would the model look as follows:

model <- lme4(SEperSECpersub ~ CS * sec + (CS|subject) + (sec|subject).

  1. Let's say the model is significant - what are the equivalent of 'follow-up tests' for situations with 2 variables and more than 2 levels per variable? I have seen websites that say to perform multiple models, adding one factor per model, and then run an anova on them to see if each variable contributes something 'significant. I have also seen certain posts say to use multcomp although users seem unsatisfied with this route.

Ultimately I'm not sure what I can do here that would give me the answers I'm looking for. As stated before, although I am trying to see the effects of all variables and their interactions, the main reason I was looking at this direction is to identify at which seconds the CS ratings differ.

Steffen Moritz
  • 1,564
  • 2
  • 15
  • 22
chainhomelow
  • 359
  • 3
  • 10

0 Answers0