# comparison between groups by mixed effect model

I would like to make a mixed effect model using "(g)lmer" in R and/or "fit(g)lme" in Matlab. However, I am not experienced with it. So please see whether I am doing right or wrong.

I need to compare behavioral outcomes (e.g., reaction times in response to stimulus onset) between two groups of subjects (e.g., 20 controls and 20 patients).

The task subjects performed include the following parameters:

• Task difficulty (0: easy, 1: difficult)
• Duration before stimulus onset (continuous value)

Each subject performed the task multiple times (e.g., 100 trials). On each trial, task difficulty and duration were chosen randomly.

The following parameters are also necessary:

• Age of each subject (continuous value)
• Group (0: control, 1: patient)

So, I made the following formula:

• reaction time ~ (Task + Duration + Age)xGroup + (Task + Duration | subject)

I want to say there are differences between controls and patients if the coefficients of variables containing "Group" (i.e., Group, Task:Group, Duration: Group, and Age:Group) are significant.

Is the above formula correct to say that?

I would also suggest that you don't limit your analysis to simply checking whether a particular coefficient "is significant", but rather you estimate and report a 95% confidence interval for each coefficient. I don't know about Matlab, but in R it is pretty easy to estimate robust confidence intervals using bootstrap (check the confint.merMod function in the package lme4).