Regress out a variable using stepwiselm?
이전 댓글 표시
Hi all,
I have a table that contains M x N predictor variables and a M x 1 response variable. The first M/2 x N predictor observations come from the same subject as the remaining M/2 x N observations (i.e. if I have 100 rows, data in rows 1:50 come from subject 1:50, and data in rows 51:100 come from subject 1:50 - they are different measures of the same subject, e.g. left arm length and right arm length).
I want to build a linear model that predicts the response variable from the predictor variables, while accounting for the fact that there is a relationship (i.e. interaction) between rows 1 and 51, rows 2 and 52, rows 3 and 53 etc. I've tried adding an index column to the table -- without much success.
I'm unsure about how to add this term in stepwiselm, or whether another function might be more appropriate?
Thank you!
댓글 수: 1
Robin
2025년 3월 25일
Add a column "Subject" to your dataset and see if it impacts your response variable?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Model Building and Assessment에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!