standard error of regression from fitlm

7 ビュー (過去 30 日間)
masih
masih 2017 年 5 月 11 日
回答済み: Gautham Sholingar 2017 年 5 月 16 日
Hi Everyone:
I am using fitlm function for linear regression of some data. How do I find the standard error of the regression? I do not want the standard error of the coefficients. Please help.

回答 (1 件)

Gautham Sholingar
Gautham Sholingar 2017 年 5 月 16 日
The linear model created by using the fitlm command has properties like MSE, Rsquared and SSE (Sum of Squared Errors) which should give you the data you want.
load hald
linearModel = fitlm(ingredients,heat);
% Mean Squared error
linearModel.MSE
linearModel.Rsquared
linearModel.SSE % Sum of squared errors
% Predict using a different data set
% using the same data set here for demonstration
prd = predict(linearModel,ingredients)
% compare to original data and measure mean squared
heat % replace with expected values
% sum of squared errors
error = sum((prd - heat).^2)
In addition, you can use the linear model to predict the output for a different data set and then use the method shown in the above code to compute the sum of the squared errors.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by