[R-sig-ME] About modelling time as continuous variable in a glmmTMB-based model.

Julian Gaviria Lopez Ju||@n@G@v|r|@Lopez @end|ng |rom un|ge@ch
Wed Jul 17 11:17:33 CEST 2019


Dear Daniel,


Thank you so much for your message. Maybe a brief contextualization might provide a clearer idea about my aims :


Conext:
Data from  50 individuals (ID) encompass 4 brain components (CAP) collected during 2 different conditions. Each condition lasted 5 minutes (split in 1-minute bins: m1, m2, ,m3, m4, m5). The data is arranged like this:

ID
Observations
  CAP
Time
1               3          C1    m1
1               0          C1    m2
1               2          C1    m3
1               0          C1    m4
1               1          C1    m5
�       �       �       �
50              0          C1    m1
�       �       �        �


                 50                                           0              C4       m5
Aim:
Based on the analysis of variance, I aim to find statistical interactions among the CAPs over time (m1... m5). Simultaneously, I want to identify whether any CAP is a better predictor of such variance, for a specific condition. For this reason, I opted for modelling the conditions in two different models.

Model:
zipoisson <- glmmTMB(Observations ~ CAP * Time + (1 | ID), data= mDATA, ziformula=~ CAP * Time , family=poisson)

According to my aims, I do not think that time should be modeled as random slope, but I really would like to hear you opinion (or the one from any other kind expert from the list) after understanding the context of my question.

P.D.  I did run the model as  random slope, such as you suggested, and I deleted the "m" from the "Time" variable,
zipoisson <- glmmTMB(Observations ~ CAP * Time + (Time | ID), data= mDATA, ziformula=~ CAP * Time, family=poisson)

Strikingly, the model did not converge for one of the conditions.


Thanks in advance and best regards.

Julian Gaviria
Neurology and Imaging of cognition lab (Labnic)
University of Geneva. Campus Biotech.
9 Chemin des Mines, 1202 Geneva, CH
Tel: +41 22 379 0380
Email: Julian.GaviriaLopez using unige.ch
________________________________
From: Daniel L�decke <d.luedecke using uke.de>
Sent: Tuesday, July 16, 2019 10:34:56 PM
To: Julian Gaviria Lopez
Cc: r-sig-mixed-models using r-project.org
Subject: Re: [R-sig-ME] About modelling time as continuous variable in a glmmTMB-based model.

Dear Julian,
typically, time varies across groups, so you should model time as random slope (i.e. switch time and ID in the random effects):

glmmTMB(Observations ~ CAP * Time + (Time | ID), data=mDATA, ziformula=~ CAP * Time, family=poisson)

Best
Daniel


Julian Gaviria Lopez <Julian.GaviriaLopez using unige.ch<mailto:Julian.GaviriaLopez using unige.ch>> schrieb am Di., 16. Juli 2019, 17:25:
Dear lists members,

Based on the glmmTMB-based model:

Model 1. Time as a fixed factor:
zipoisson <- glmmTMB(Observations ~ CAP * Time + (1|ID), data=mDATA, ziformula=~ CAP * Time , family=poisson)

A gentle member from this list suggested me to treat time as continuous.  Since I am new with mixed models, I would like to confirm that the new models for this aim are right:

Model 2. Time as continuous variable:
zipoisson <- glmmTMB(Observations ~ CAP * Time + (ID|Time), data=mDATA, ziformula=~ CAP * Time, family=poisson)

Model 3.  Time as continuous, with the dispersion parameter identical for each observation:
zipoisson <- glmmTMB(Observations ~ CAP + (ID|Time), data=mDATA, ziformula=~ 1, family=poisson)


It calls my attention that models 1 and 2 yield the same results. In this way, I wonder whether I did model time properly. Maybe I should introduce the levels of "Time" differently?

current arranging of time data:
Time
  m1
  m2
  m3

Alternative option?
TIme
   1
   2
   3


I thank you in advance for any comment in this regard.

Best regards,


Julian Gaviria
Neurology and Imaging of cognition lab (Labnic)
University of Geneva. Campus Biotech.
9 Chemin des Mines, 1202 Geneva, CH
Tel: +41 22 379 0380
Email: Julian.GaviriaLopez using unige.ch<mailto:Julian.GaviriaLopez using unige.ch>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-mixed-models using r-project.org<mailto:R-sig-mixed-models using r-project.org> mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

________________________________

Universit�tsklinikum Hamburg-Eppendorf; K�rperschaft des �ffentlichen Rechts; Gerichtsstand: Hamburg | www.uke.de<http://www.uke.de/>
Vorstandsmitglieder: Prof. Dr. Burkhard G�ke (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Pr�l�, Marya Verdel

________________________________

SAVE PAPER - THINK BEFORE PRINTING

	[[alternative HTML version deleted]]



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