library(knitr)

The data

library(tidyverse)
library(psycho)

df <- psycho::emotion %>% 
  mutate(Trial_Order = as.factor(Trial_Order)) %>% 
  standardize()

Fit Models

library(lme4)
library(optimx)

fit_model <- function(random){
  fit <- lme4::glmer(paste("Recall ~ Emotion_Condition / Subjective_Arousal + ", random),
              data=df, 
              family = "binomial", 
              control = glmerControl(optimizer = "optimx", 
                                     calc.derivs = FALSE,
                                     optCtrl = list(method = "nlminb")))
  return(fit)
}



fit1 <- fit_model(random="(1|Participant_ID)") 
analyze(fit1, CI=NULL)

fit1 <- fit_model(random="(1|Participant_ID) + (1|Item_Name)") 
analyze(fit1, CI=NULL)

fit1 <- fit_model(random="(1|Participant_ID) + (1|Item_Name) + (1+Emotion_Condition|Participant_ID)") 
analyze(fit1, CI=NULL)

Conclusion

Contribute

Of course, these reporting standards should change, depending on new expert recommandations or official guidelines. The goal of this package is to flexibly adaptive to new changes and good practices evolution. Therefore, if you have any advices, opinions or such, we encourage you to either let us know by opening an issue, or even better, try to implement them yourself by contributing to the code.

Credits

This package helped you? Don't forget to cite the various packages you used :)

You can cite psycho as follows:

Previous blogposts



neuropsychology/psycho.R documentation built on Jan. 25, 2021, 7:59 a.m.