필터 지우기
필터 지우기

NaNs and regress lead to error?

조회 수: 3 (최근 30일)
chiefjia
chiefjia 2021년 11월 5일
답변: Prince Kumar 2021년 11월 24일
Dear MATLAB experts,
I'm conducting multiple regressions with the function:
regress
In some of the regressions, data of the dependent variable is missing. And as I have read in the documentation, 'regress' removes all rows that contain NaNs. I was wondering if the corresponding rows of the independent variable will be removed, as the independent variable is formed by the same number of rows as the dependent variable in each regression. In any case, would this also lead to estimation errors?
Edit: imputing the missing values is not an option
I would really appreciate your help, since this is urgent for a project.
Thank you in advance
  댓글 수: 2
KSSV
KSSV 2021년 11월 5일
You can fill the NaN's using fillmissing.
chiefjia
chiefjia 2021년 11월 5일
I already did that for some of them, but there is no good alternative for filling in the remaining missing values, since the existing methods lead to estimation errors.

댓글을 달려면 로그인하십시오.

답변 (1개)

Prince Kumar
Prince Kumar 2021년 11월 24일
Hi Chiefjia,
Yes, if the rows contains NaNs, then the corresponding rows of independent variable will also be removed. This means that your training data would reduce.

Community Treasure Hunt

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

Start Hunting!

Translated by