[R-sig-ME] Modeling and Interpretation Question for Interaction in LMER Output.

Thierry Onkelinx th|erry@onke||nx @end|ng |rom |nbo@be
Wed Jun 24 19:06:19 CEST 2020


Dear James,

I wrote a blog post on using a variable both as fixed and random (
https://www.muscardinus.be/2017/08/fixed-and-random/). Your case isn't
handled in that blog post. But the same reasoning applies. Both categorical
doesn't make sense. One continuous and one categorical can make sense
(depends on the structure in the data). The blog post provides some clues
to determine it on your data.

Don't use explicit nested random effects, use implicit nesting: create a
new variable pid2 = interaction(pid, task). Then update the model to
(1|pid) + (1|pid2) The model will figure out the structure from the data.

Note that the lmer() model doesn't handle correlated residuals like lme()
does.

Best regards,

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx using inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////

<https://www.inbo.be>


Op di 23 jun. 2020 om 20:31 schreef Ades, James <jades using health.ucsd.edu>:

> Hi all,
>
> I looked through several different nlme sources and this is what seemed to
> be the equivalent model using corCAR1(). I have two questions: is it
> legitimate to put timepoint (character, 4 "levels") as a fixed effect while
> keeping t4 (time, numeric, days from first testing point) as the random
> slope, so that I can have a more interpretable outcome to assess the
> effects of time per cohort with emmeans? 2) As you can see in the lmer()
> model, there are random effects of pid as well as an interaction between
> pid:task; however, what I've coded above seemed to be the equivalent in
> nlme. Is that accurate, or is there a different way of coding that
> interaction?
>
> lme(level ~ task + timepoint * cohort,
>     random = list(pid = ~t4, task = ~t4),
>     correlation = corCAR1(),
>     dat)
>
>
> lmer(level ~ task + t4 * cohort + (t4|pid) + (t4|pid:task))
>
> Thanks!
>
> James
>
>
> ________________________________
> From: David Duffy <David.Duffy using qimrberghofer.edu.au>
> Sent: Thursday, June 11, 2020 7:53 PM
> To: Ades, James <jades using health.ucsd.edu>; r-sig-mixed-models using r-project.org
> <r-sig-mixed-models using r-project.org>
> Subject: Re: Modeling and Interpretation Question for Interaction in LMER
> Output.
>
> > The modeling question regards my depiction of time. The amount of
> elapsed time
> > between participants and testing points is not equal equal. Students in
> the same classroom
> > will be measured at equal time points, but while one class might have 4
> months
> > in between testing, another class might have 7 months.
>
> In lme, AIUI this would be comparing different correlation structures, as
> per the example for
> corCAR1().
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]



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