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

208 ビュー (過去 30 日間)
Leon
Leon 2016 年 8 月 19 日
コメント済み: Star Strider 2016 年 8 月 19 日
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!

採用された回答

Star Strider
Star Strider 2016 年 8 月 19 日
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 件のコメント
Leon
Leon 2016 年 8 月 19 日
Many thanks! I didn't know RMSE is the same thing as standard deviation :-)
Star Strider
Star Strider 2016 年 8 月 19 日
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.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Regression についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by