필터 지우기
필터 지우기

Multilinear Regression using regstats

조회 수: 2 (최근 30일)
Lindsey
Lindsey 2014년 7월 15일
답변: Roger Wohlwend 2014년 7월 16일
I have a series of data points that I would like to find a regression for. There are 97 data points and I want to use regstats to find the linear regression. I tried using:
regstats(X,Y,'linear')
For X, I inputted the x values of my data points and for Y, I inputted the y values for all of the points. I am not understanding how regstats works, does anyone know what I should be inputting instead?
This is the error I am getting:
Undefined function 'regstats' for input arguments of type 'double'.
Error in Test_Import_ASCII (line 13) stat = regstats(X,Y, 'linear','beta');
Thank you

답변 (1개)

Roger Wohlwend
Roger Wohlwend 2014년 7월 16일
Use the function as follows:
stat = regstats(Y, X);
Ommit the third and forth arguments. Especially the last. The function returns a lot of useful information on the regression (t-values, r-square, ...), and if your forth argument is 'beta', you only get the coefficients. If you are only interested in coefficients, use the function regress because it is faster than regstats. Use regstats if you want that whole other stuff about the regression (t-values, r-square, mse, f-statistics, ...), too.

카테고리

Help CenterFile Exchange에서 Model Building and Assessment에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by