Multilinear Regression using regstats
조회 수: 2 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
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.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!