How to specify this mixed effects model?
Show older comments
I need to specify a model (for input into fitlme). My experimental design is very similar to the indomethacin example in the documentation for nlmefit, but with a slight extension. I'm not sure how to specify the model.
In that example, there are 6 test subjects, who represent a sample from the broader population. It is therefore appropriate to use a random effect to capture the subject-specific effect (as the example shows).
If it were appropriate to use fitlme for the indomethacin example, the model could be specified in Wilkinson notation as
'concentration ~ 1 + time + (time|subject)'
The model has a fixed effect for time, and (possibly correlated) random effects for the intercept and slope for each subject.
My extension of this example is that for each subject, I am going to take their blood sample and have their blood level tested two or more times by the lab at each time point. (This is known as using "technical replicates", to account for variability in the chemical test itself.)
How would I specify that model? My best guess is to define a categorical replicate variable, which has a unique value for each blood sample. The indomethacin example has 11 time points and 6 subjects, for a total of 66 observations. If I now want 2 technical replicates, then I would have 132 observations, where I would define
replicate = categorical((1:132)');
and the model would be specified as
'concentration ~ 1 + time + (time|subject) + (time|subject:replicate)'
Does that seem right?
1 Comment
the cyclist
on 2 Feb 2018
Edited: the cyclist
on 2 Feb 2018
Accepted Answer
More Answers (0)
Categories
Find more on Linear Predictive Coding in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!