Mixed terms and fitlmematrix
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi all,
I'm trying to create a linear mixed effect model where I have three fixed effects (X1, X2, X3) and one random effect (Z1) using fitlmematrix.m.
The issue I'm having is that I'm not sure how to get results for "mixed" terms, i.e. X1*X2, X2*X3, X1*X2*X3. When I look up the help for the linear mixed model class I can see the "Formula" member, but I'm not sure how to specify it when calling fitlmematrix.m.
I'm under the impression that LMMs handle mixed terms differently to including them directly in the system matrix (i.e. creating X4 = X1*X2 etc).
Any help on how to get the mixed terms into the model would be greatly appreciated, Andrew
0 Commenti
Risposte (1)
Peng Li
il 7 Ago 2020
For new versions of MATLAB, you can use fitlm, fitlme, fitglme which allows table input, and allows formulas.
But if you use fitlmematrix, you can generate the interaction items manually but timing the two variables, or three variables together. You may need to center the continuous variables in order for a 'meaningful' results.
0 Commenti
Vedere anche
Categorie
Scopri di più su Dimensionality Reduction and Feature Extraction in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!