Missing Observations error when running regression

조회 수: 2 (최근 30일)
Sam P
Sam P 2018년 6월 6일
댓글: Sam P 2018년 6월 6일
I am using MATLAB to complete some regression analysis,
Say I have 40 variables, 35 have the full dataset, monthly data from 1950-2010,
However, some have missing values at the start of the data set,
For example, 36 may only have 1969-2010, 27 1952-2010,
I tried to replace all blanks with a NaN and got the error message,
"Error using svd Input to SVD must not contain NaN"
Is there something I can do?
  댓글 수: 1
Sam P
Sam P 2018년 6월 6일
To be more clear,
I want to just run the shorter regression,
So if the data is missing,
I want to run y =beta(x),
If x36 only starts from 1952 I want the output of the above equation from 1952

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

답변 (1개)

Shrestha Kumar
Shrestha Kumar 2018년 6월 6일
Hi,
You can replace NaN with the mean of the data in the column(if it is a numerical value else take the mode). Also, NaN values can be present in the test data, so take care of that too.

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by