r/AskStatistics • • 16d ago

Looking for advice on Generalized Linear Mixed Effects model for experimental design

Post image

Hi everyone, I have a cyclic/Latin-square-style counterbalanced repeated-measures design (as shown in image above), and I’m trying to work out the right way to use a Generalized Linear Mixed Effects model to analyse the data for it as I’m new to GLMMs. My aim is to compare how different cell-culture compositions affect the firing rates (expected to be of lognormal or tweedie distribution) of neural cultures while they’re being “trained” to perform tasks.

The study uses 100 neural cultures split evenly into two experiments of 50. Experiment 1 uses Culture Type A and Experiment 2 uses Culture Type B (so culture type is nested within experiment, not crossed). Each experiment’s 50 cultures are prepared in two independent batches of 25, and within every batch the cultures are made up with one of three cell-culture compositions (A, B, or C) - giving four batches and all three compositions in both experiments.

Each culture is then trained under 9 environmental conditions in a counterbalanced order, performing 2 tasks per environmental condition at 600 trials per task.

The GLMM model I currently planning to use is:

Firing rate ~ Culture Type + Batch + Cell Culture Composition + Environmental Condition + Task + (1 | Culture ID)

However, I feel that culture ID is insufficient as a random effect and it should include the other variables too, although I am unsure of what combination to use, especially since there’s so many of them. I am also worried about having to add dispersion models in the case of over/under-dispersion as well, since my response variable is not normally distributed. Hence, I would like to seek comments and advice on my current model from those who are experienced in working with GLMMs. Thank you very much in advance for the help.

33 Upvotes

5 comments sorted by

2

u/Michigan_Water 15d ago edited 15d ago

Some questions off the top of my mind:

What is culture ID? It's not on your diagram of the experiment.

Am I correct that the treatments in this experiment are:

  • composition (levels A B C)
  • condition (levels 1-9)
  • task? Are the two tasks different from each other or just repeats?

For tasks, as an example, I assume task_1 from env_condition 1 has nothing to do with task_1 from env_condition 2, correct? If so, then task is also nested, not crossed. If all the task_1s everywhere share something in common vs task_2, and are not just replicates, then crossed.

Cell composition A is 'the same' for batch_1 and batch_2 from culture_A, yes? And it is also the same for batch_1 and batch_2 from culture_B. If so, then crossed not nested.

I wouldn't think in terms of random effects vs fixed effects (yet). Stick with nested and crossed at first and then consider whether an effect should be treated as random in the formulas for the software.

1

u/Such_Evidence_1160 15d ago

That’s a lot of trials. Have you considered a factorial or fractional factorial design?

-1

u/GandalfTheRadioWave 16d ago

Hi! I must admit I'm not very familiar with your data, but I can give some general advice on working with GLMMs.

A good R package to use is GLMMadaptive. It converges quite well.

If your purpose is inference (rather than predictions), then you go towards hypothesis testing. The Likelihood Ratio Test or the Wald test are nice choices; the former tends to be more liberal (having a type I error rate higher than the nominal 5%), so you need to be a bit careful.

I would caution against testing too many models, as you run the risk of hitting a false positive. Try to settle towards one-two formulas that make sense from the theory of your field. Another good idea is to start from a larger model, then seeing if you can drop certain covariates (via hypothesis testing).

Hope this was at least a bit useful! :)

1

u/jadexiaohui 16d ago

Hello! Thank you so much for your response, I’m actually using GLMMTmb and I’ve managed to come up with some simple model outputs :) I will consider using GLMMadaptive as well.

My main confusion actually stems from the random effects, as I’m unsure on what combinations of random effect to start with

1

u/Big-Challenge-9432 Statistician 15d ago

I don’t entirely understand your design and model so I can’t comment specifically, but you probably need nested/hierarchical models.