Multilinear Regression using regstats
3 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Roger Wohlwend
on 16 Jul 2014
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 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!