[R-sig-ME] random effects - multiple sessions

ji@verissimo m@iii@g oii gm@ii@com ji@verissimo m@iii@g oii gm@ii@com
Thu Feb 10 20:22:46 CET 2022


On Thu, 2022-02-10 at 18:36 +0000, Cátia Ferreira De Oliveira wrote:
> Dear Dr. João Veríssimo,
> Why did you remove the random slope for prob in your example? When
> that's the learning effect I'm interest in?rt ~ 1 + session +
> prob:session + (1 + session + prob:session | subj)

If session and prob are both factors, this formula should give you
estimates for the effect of prob in session 1, effect of prob in
session 2, and effect of prob in session 3 (if I'm seeing this
right).So the random slopes for prob are still there - in fact, the
model contains random slopes for prob in each of the sessions.

> Best wishes,
> 
> Cátia
> 
> A quarta, 9/02/2022, 20:28,  <jl.verissimo using gmail.com> escreveu:
> > Hi Cátia,
> > This depends on the contrasts of session AND prob.With treatment
> > contrasts for session and session 2 as the reference level (for
> > example), you'd get the 1vs.2 and 2vs.3 comparisons, and  you could
> > simply do the same kinds of sums that you already did to get all
> > three effects.
> > Alternatively,rt ~ 1 + session + prob:session + (1 + session +
> > prob:session | subj)would give you the prob effect in each of the
> > three sessions, as well as by-participant random adjustments on
> > those. Perhaps this is a more direct way of getting what you're
> > after.
> > To bring group in.... not sure. Maybe:
> > 1 + group * (session + prob:session)
> > João
> > On Wed, 2022-02-09 at 19:31 +0000, Cátia Ferreira De Oliveira via
> > R-sig-mixed-models wrote:
> > > Hello,
> > > I am interested in modeling a learning effect per session and
> > > perparticipant and then extracting the random effects per
> > > participant so I canuse them for correlations. How can I do that?
> > > If I have one contrast between 2 sessions (1 vs 2) I would do:
> > > model_all = lmer(rt ~ group * prob * session +
> > > (1+prob*session|subj),data=session, REML=FALSE)
> > > df_all = data.frame(coef(model_all$subj))
> > > df$session_1 = df$prob
> > > df$session_2 = df$prob + df$session + df[, "prob:session"] # add
> > > up themain-effects and the interaction to get the other
> > > sessionBut how can I extend this if I have 3 sessions and I want
> > > to contrast themsequentially - 1 vs 2 and then 2 vs 3?
> > > Thank you,
> > > Catia

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list