How do I find the standard deviation of my linear regression?

204 visualizzazioni (ultimi 30 giorni)
I am using fitlm to do a very simple two-variable linear regression: md1 = fitlm(x,y);
Here are my results:
md1 =
Linear regression model:
y ~ 1 + x1
Estimated Coefficients:
Estimate SE tStat pValue
________ __________ ______ ______
(Intercept) 0.14936 0.0022171 67.368 0
x1 0.98095 0.00028117 3488.8 0
Number of observations: 278412, Error degrees of freedom: 278410
Root Mean Squared Error: 0.0203
R-squared: 0.978, Adjusted R-Squared 0.978
F-statistic vs. constant model: 1.22e+07, p-value = 0
So what is my standard deviation?
Thanks!

Risposta accettata

Star Strider
Star Strider il 19 Ago 2016
If you want the standard deviation of the residuals (differences between the regression line and the data at each value of the independent variable), it is:
Root Mean Squared Error: 0.0203
or the square root of the mean of the squared residual values.
  2 Commenti
Leon
Leon il 19 Ago 2016
Many thanks! I didn't know RMSE is the same thing as standard deviation :-)
Star Strider
Star Strider il 19 Ago 2016
My pleasure!
In this instance, it is. It is the standard deviation of the residuals. The ‘usual’ definition of the standard deviation is with respect to the mean of the data. In a regression, the mean is replaced by the value of the regression at the associated value of the independent variable. The use of RMSE for a regression instead of standard deviation avoids confusion as to the reference used for the differences.
The Wikipedia article on Root-mean-square deviation goes into its usual exhaustive detail.

Accedi per commentare.

Più risposte (0)

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by