Mixed terms and fitlmematrix

4 visualizzazioni (ultimi 30 giorni)
Andrew
Andrew il 18 Ott 2013
Risposto: Peng Li il 7 Ago 2020
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

Risposte (1)

Peng Li
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.

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!

Translated by