Filter löschen
Filter löschen

Multilinear Regression using regstats

2 Ansichten (letzte 30 Tage)
Lindsey
Lindsey am 15 Jul. 2014
Beantwortet: Roger Wohlwend am 16 Jul. 2014
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

Antworten (1)

Roger Wohlwend
Roger Wohlwend am 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.

Community Treasure Hunt

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

Start Hunting!

Translated by