How can I fit a linear mixed-effects model with only quadratic/second-order terms?

8 ビュー (過去 30 日間)
Ben Gold
Ben Gold 2018 年 3 月 22 日
回答済み: Peng Li 2020 年 8 月 6 日
Hello,
I'm trying to fit a linear mixed-effects model with fitlme, e.g.: quadmdl = fitlme(Data,'DV ~ X1^2 + (1 + X1^2 | Subject)');
This models fixed effects for both X1 and X1^2, but I only want to model X1^2. In other words, I want my model to have the quadratic (second-order) term without the linear (first-order) one: DV ~ X1^2 + (1 + X1^2 | Subject) as opposed to DV ~ X1 + X1^2 + (1 + X1 + X1^2 | Subject).
Is there a way to specify this in the model?
Thanks!

回答 (1 件)

Peng Li
Peng Li 2020 年 8 月 6 日
This is an old post now. Just for future readers, you can explicitly get rid of any items you don't want by minus it. For the questions above, the formula can be DV ~ X1^2 - X1 + ...

カテゴリ

Help Center および File ExchangeFit Postprocessing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by