0
$\begingroup$

I attached a data here called image_study. The “image_study.csv” dataset contains data from a study examining the speed of classification of two different types of image: artworks, and natural images. There are four variables in the data as follows:

participant – a unique identifier for each participant

image – a unique identifier for each image

image_type – a factor indicating whether a given image is an Artwork or a Natural image.

RT – reaction time in milliseconds

I want to model reaction times (RT) as a function of the other variables in the dataset. The purpose here is to examine the effect of Image-type on RT.

  1. Which of the fixed effect, random effect, or mixed effect model modes should I choose?
  2. Which participant or image variables should be considered as a random effect in the model? enter image description here enter image description here
$\endgroup$
5
  • $\begingroup$ @MrFlick I want to know the code related to R software about this question. $\endgroup$ Jun 5 at 3:59
  • $\begingroup$ You need to choose a model first. R can't tell you which model to use or how to model your data (fix vs random effects). Those are statistical concerns, not programming concerns. You need to know what you want to do before you can write R code to do it. $\endgroup$
    – MrFlick
    Jun 5 at 4:06
  • $\begingroup$ @MrFlick Both model selection and code writing in R are what I want. I also do not know what model to choose, nor do I know how to run it in R. (I am very familiar with R software). $\endgroup$ Jun 5 at 4:10
  • $\begingroup$ What do you think is the appropriate model, given your data and question? $\endgroup$ Jun 5 at 5:22
  • $\begingroup$ @AngelosAmyntas the crossed mixed effect model is the appropriate model for this question. $\endgroup$ Sep 27 at 10:12
3
$\begingroup$

Since you say:

The purpose here is to examine the effect of Image_type on RT.

then we need a regression model with RT and the response and image_type as the main exposure (fixed effect).

Since you have repeated measure within both participant and image then you should fit random intercepts for both of these.

Furthermore, since participant and image appear to be crossed (from the data picture all images were seen by participant 1 and that appears to repeat for participant 2), then the following model should be appropriate:

RT ~ image_type + (1|participant) + (1|image)

which is the syntax you would use with popular R packages such as lme4. eg:

library(lme4)
model <- lmer(RT ~ image_type + (1|participant) + (1|image), data = image_study
summary(model)
$\endgroup$
8
  • 1
    $\begingroup$ people often use identity-link Gamma models to model reaction time (I don't necessarily think this is a good idea, but they do it): glmer(..., family=Gamma(link="identity")) $\endgroup$
    – Ben Bolker
    Jun 6 at 1:45
  • $\begingroup$ @BenBolker what is the default link function and distribution for random effect models? $\endgroup$ Jun 6 at 4:15
  • $\begingroup$ See here for a discussion about the link function for gamma models $\endgroup$ Jun 6 at 7:10
  • $\begingroup$ @BenBolker Indeed, I have seen that too, it often seems to arise from poorly fitting linear models, but I'm not sure the gamma models always improve things. For example here, here,and here $\endgroup$ Jun 6 at 7:54
  • $\begingroup$ @MehdiLoohs generally Gaussian/identity $\endgroup$
    – Ben Bolker
    Jun 6 at 15:19

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.