# Modelling correlated and longitudinal complex dataset with mice

tl;dr: I need help to analyze a complex dataset from experiments with mice. This experiment yielded a very complex data structure that I’m not sure how to model. Given the correlation and longitudinal pattern, I thought about @f2harrell’s Bayesian transition models for ordinal longitudinal outcomes, but I am unsure if they fit well in this case.

Background: Mice are kept in cages with other mice (a total of 4 in each cage).

The experiment involves separating a mouse or group of mice from its original cage by placing them in another cage and then measuring some outcomes. After each experiment, mice are put back together in their original cage with their original fellows.

There are three different “separation patterns” for new cages:

• 1 mouse alone
• A pair of mice
• All four mice

These separations occur multiple times across each mouse’s lifespan. Mice were organized into two cohorts, one of which was tested at 10, 20, and 30 days old, while the other was tested at 30, 40, and 50 days old.

These experiments happened at five different ambient temperatures.

In summary, for each of the ages mentioned above (5 options), we have data on 3 separation patterns by 5 different temperatures.

5 x 3 x 5 = 75 experiments

A specific mouse was not tested all 75 times, but it was tested multiple times (I’m not sure how many times exactly). Please note that the data is clustered by mouse (the same animal is tested multiple times) and by their original cage (mice that live together tend to behave alike).

Our primary outcome is a mouse-level measurement that is continuous and can only be greater or equal to 0.

Our research questions are:

• At each age, what is the difference in outcome between the separation patterns (“all four mice” as reference)? Does ambient temperature interact with the difference?
• Does age interact with the difference in outcome between the separation patterns?

How would you model this data?

1 Like

ChatGPT suggested:

glmmTMB(Outcome ~ SeparationPattern*Temperature * Age + (1 | MouseID) + (1 | CageID),
data = dataset,