Learning new things is HARD. Stats methods are particularly hard because it not just about running the test. You have to…
Part of what makes this learning hard is that our research methods training has drummed into us that there is a RIGHT WAY TO DO IT.
In the real world, there are LOTS OF WAYS TO DO IT. Some ways might be more appropriate than other ways, given the data you are dealing with or the question you are most interested in. But people who teach statistics have VERY STRONG OPINIONS, like…
Reading this Magezi paper https://t.co/FJl2KbHOyn - apparently "encouraging experimental psychologists to use LMM is like giving shotguns to toddlers" awesome- this is not the first time this week I have felt like an #rstats baby pic.twitter.com/NvWLMlzBvT
— Dr Jenny Richmond (@JenRichmondPhD) September 20, 2018
As a learner who is trying to teach themselves a new method, it is tough to give up on the idea that the goal is to work out the RIGHT WAY. It is also difficult to work out which ways might be better than others, because research methods training seldom teaches you how to evaluate the suitability of a particular approach, given the particular data situation you are in. Most often when you are learning statistics you are working with “perfect” data; data in the real world is never perfect, particularly when you work with infants and kids.
I think we need to change the way we teach research methods to psychology students, but that is another post for another day.
Today I have worked out how to run the test… now I need to interpret the results and write about them.
What to do? Ask for help…
I have worked out how to run a linear mixed model in #rstats (see rest of thread for resources I found helpful), but now I'm pretty stuck with how to write about it. Looking for tips...papers that report LMM, preferably in exp psyc, ideally development @Infantstudies @SRCDtweets pic.twitter.com/Ze6l7qT8Kc
— Dr Jenny Richmond (@JenRichmondPhD) September 20, 2018
Jessica Koski’s suggestion to look at papers that use LMM in a similar context (particularly Mike Frank’s papers in my case) was a good one. This is true of writing in general, not just writing about stats. There is value in emulating those who you think do it well.
Mike also weighed into the conversation (how great is twitter?) and shared his reporting rules:
That’s really nice Jessica! My rules: make sure to describe the full specification including random effects (maybe with model formula), try to give fixed effects coefficients in a table so readers can interpret, at least for your main model.
— Michael C. Frank (@mcxfrank) September 21, 2018
Looking at developmental science papers that have reported LMM, I found two papers that I PARTICULARLY liked.
This baby monkey imitation paper might be my favorite example. It could be because the format of Scientific Reports is nice, but I think the reporting about what they did and what they found is clear. I like this table and can see how it is helpful to the reader to see the coefficients for each model.
knitr::include_graphics("monkey table.png")
This recent paper out of Mike’s lab is SUPER useful because the R markdown file is on github, so you can compare the rstats code/output to what is reported in the paper.
Go open science!
…rather than some more well known analysis like repeated-measures ANOVA.
THEORETICAL REASON
PRACTICAL REASON
…because as we know there are MANY ways.
We ran linear mixed model analysis in R (version …) using the lme4 package (Bates, Maechker, Bolker, & Walker, 2015). We included EMG response as the dependent variable and added fixed effects of emotion, muscle, as well as the interaction between emotion and muscle. We included Participant as a random effect. Significance was calculated using the lmerTest package (Kuznetsova, Brockhoff, & Christensen, 2017), which applies Satterthwaite’s method to estimate degrees of freedom and generate p-values for mixed models.
I have seen this done in text, or in a footnote, but the idea is to spell out the formula.
The model specification was as follows: EMGresponse ~ emotion + muscle + emotion*muscle + (1|Participant)
My conclusion is that most people just report coefficients (and they talk about them much like you would main effects and interactions in a repeated-measures ANOVA). There is the occasional nod to Likelihood Ratio Tests, i.e. they might say that the model with the interaction term included did not improve the fit, so they stuck with only main effects, but I didn’t see a lot of people comparing a model that includes all the interesting things and one that doesn’t.
Here is the plot and analysis output:
knitr::include_graphics("browcheek.jpg")
knitr::include_graphics("output.png")
There were significant main effects of emotion (beta = -0.20, t = -2.69, p = .009) and muscle (beta = -0.16, t = -2.26, p = .03), along with an emotion by muscle interaction that approached significance (beta = -0.20, t = 1.97, p = .05), reflecting the fact that while there was differential Brow activity in response to angry and happy faces displayed by a competitor, Cheek activity did not differ as a function of emotion.
generally when I get a significant emotion by muscle interaction, I want to do post-hoc tests or look at contrasts to drill down into whether the response to angry is significantly greater than happy and that there is no significant difference in cheek activity to happy and angry. The psycho
package process included running contrasts, but in all of my reading I didn’t see anyone report contrasts. Is that not a thing in LMM?
when initially looking at LMM output, I was thrown by the way that the main effects are expressed as emotionHAPPY and muscleCHEEK and the interaction is emotionHAPPY:muscleCHEEK.
I think that has something to do with the reference level. If you don’t tell it to do it another way, R will assign your reference levels alphabetically. So here the effects are specified relative to ANGRY and BROW.
In the Nordmeyer paper, they talk about categorical variables being “deviation coded”. My understanding is that rather than using ANGRY and BROW as your levels, you replace them with -0.5 and 0.5 to make the reference level more meaningful, and as a result your model more interpretable.
Linear mixed models (LMM) are a becoming a popular alternative to repeated-measures ANOVA analyses in experimental psychology (Magezi, 2015). In looking at the effects of emotion and muscle on EMG activity in our experiment, there are two key advantages of a LMM approach over repeated-measures ANOVA. First, when using LMM it is possible to specify random effects (i.e. Participants). Rather than bundling this variance into an error term, linear mixed models allow us to partition the variance that is associated with these differences explicitly. Second, linear mixed models cope with missing data more easily than repeated-measures ANOVA. In the case of this dataset, there were a number of children for whom EMG data from one or more conditions was excluded due to excessive electrical noise, movement artifact or inattention. For this reason, a linear mixed models approach was most appropriate.
We ran linear mixed model analysis in R (version …) using the lme4 package (Bates, Maechker, Bolker, & Walker, 2015). We included EMG response as the dependent variable and added fixed effects of emotion, muscle, as well as the interaction between emotion and muscle. We included Participant as a random effect. Significance was calculated using the lmerTest package (Kuznetsova, Brockhoff, & Christensen, 2017), which applies Satterthwaite’s method to estimate degrees of freedom and generate p-values for mixed models. The model specification was as follows: EMGresponse ~ emotion + muscle + emotion*muscle + (1|Participant).
There were significant main effects of emotion (beta = -0.20, t = -2.69, p = .009) and muscle (beta = -0.16, t = -2.26, p = .03), along with an emotion by muscle interaction that approached significance (beta = -0.20, t = 1.97, p = .05), reflecting the fact that while there was differential Brow activity in response to angry and happy faces displayed by a competitor, Cheek activity did not differ as a function of emotion.