How to remove an interaction term from a regression?

3 ビュー (過去 30 日間)
Mostafa
Mostafa 2022 年 4 月 14 日
コメント済み: Mostafa 2022 年 4 月 14 日
Hello everyone,
Following my question here, I am looking for a way to drop an interaction term that is the interaction of one category of a categorical variable (say sex_Male) and another category of another categorical variable (say, frame_demand).
Is it possible to remove this specific interaction (sex_Male:frame_demand) and not the whole interaction between two categorical variables (sex:frame) or not the the categories (sex_Male or frame_demand)?
Thanks!
Mostafa
  1 件のコメント
Mostafa
Mostafa 2022 年 4 月 14 日
I found the solution and instead of deleting the question, I am writing my answer to help someone else who may face the same issue.
In order to remove specific interactions from a regression, I converted all categorical variables into dummy variables. We now have a variable associated with each category whose interaction can be easily excluded from the model specification (The reference categories must also be excluded, obviously).
I excluded the problematic interaction from the formula and it worked without any rank deficient error either with or without random-effect.

サインインしてコメントする。

回答 (0 件)

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by