I read up quite a number of resources and I'm still unsure how/if I am applying the lmer correctly for my data.

I'm looking for between-group differences in response rates (controlling for baseline values) for 4 incentive groups (there is a within-subjects factor and a between-subjects factor, and it is the group*round interaction that I am interested in).

My data looks like this:

enter image description here

After reading some of the forums and papers, based on what I understood, I coded it this way:

lmer(response_rate ~ Round + Group + Round*Group + (1|ID), data=data)

Just wanted to check if this makes sense/if this is correct?

Any advice/help would be greatly appreciated. Or if there are any basic resources on this for a beginner in stats would also be great.

Thank you so much! :)

  • $\begingroup$ You have not included baseline which you stated you wanted to include. $\endgroup$
    – mdewey
    Mar 11, 2022 at 11:42
  • $\begingroup$ To follow up on the comment from @mdewey : is Round 1 perhaps the "baseline" for the Round 2 observations? Are there only 2 observations on each individual, one in each Round? Also, what is the "response rate": is it something like a count, or a fraction of trials with a certain outcome? $\endgroup$
    – EdM
    Mar 11, 2022 at 13:31
  • $\begingroup$ Hi :) thanks so much for replying to my query. It's an RCT with different rounds, and baseline will be round1, and round2 are observation rounds. response_rate is the percentage of surveys done for each participant per round. Eventually there will be a total of 3 rounds done - but for now I am just looking at round1 and round2. $\endgroup$
    – Laur M
    Mar 15, 2022 at 2:51

1 Answer 1


As far as I know, it seems correct. Indeed, you could also try: lmer(response_rate ~ Round*Group + (1|ID), data=data) since the interaction by force includes the "individual" variables making it up. Adding to the answer, now that you have added info. The key variable is of course response rate. You said it is proportional, so seems that a binomial glmer would be the best bet. See: Fitting a binomial GLMM (glmer) to a response variable that is a proportion or fraction. As per the R help, "the binomial family [uses] the links logit, probit, cauchit, (corresponding to logistic, normal and Cauchy CDFs respectively) log and cloglog (complementary log-log). logit is the most common. However, I would urge caution. Read up on this topic, as it can be quite complicated. I still dont understand it fully myself. I have some references I can give you if you like.

  • $\begingroup$ Welcome! That's basically correct. (+1) Remaining questions are whether that's the best use of the data and if glmer might be needed. With only 2 observations per individual, one might "control for baseline" by evaluating Round2-Round1 differences in a one-way ANOVA (extending paired t-tests to 4 groups). That approach would avoid modeling the distribution of random intercepts. It wouldn't, however, allow for evaluation of differences among groups in Round1 values; your approach would. lmer vs glmer depends on the nature of the response_rate, which isn't clear from the question. $\endgroup$
    – EdM
    Mar 12, 2022 at 18:21
  • $\begingroup$ I think the reason why I chose to use lmer would be because its an RCT with 3-4 rounds, but for now I am just looking at group*time interaction between round1 (baseline) and round2, and eventually might look at interactions between all 3/4 groups. regarding response_rate, there were total of 30 surveys administered to each participants, and response rate was calculated by: (number of surveys done on each round)/30*100 $\endgroup$
    – Laur M
    Mar 15, 2022 at 3:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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