Standard deviation of each coefficient of regression model

조회 수: 11 (최근 30일)
padam bahadur karki
padam bahadur karki 2023년 3월 26일
댓글: padam bahadur karki 2023년 3월 26일
I have develop a quadratic regression model based on my data set,
such as,
y = B0 + B1X1 + B2X2 + B2X1^2 + B3X2^2
To develop this model, I use the 'fitlm' funciton. Now I have a model coefficients for each variables(B0, B1, B2, B3). I
Now I want to estimate the standard deviation of each coefficients.
Could you please share an idea how I can estimate the standard deviation of each coefficients based on the response from 'fitlm' function.
Your response will be highly appriciated.

답변 (1개)

Jack
Jack 2023년 3월 26일
Hi,
You can estimate the standard deviation of the regression coefficients using the coefCI function in MATLAB, which is available for models created using the fitlm function.
The coefCI function returns the confidence intervals for the estimated coefficients, which can be used to estimate the standard error of the coefficients by dividing the range of the confidence interval by 3.92 (for a 95% confidence interval) or 1.96 (for a 90% confidence interval).
Here's an example of how to use the coefCI function to estimate the standard deviation of the coefficients:
% generate some sample data
x1 = randn(100,1);
x2 = randn(100,1);
y = 2 + 3*x1 + 4*x2 + 1.5*x1.^2 + 2*x2.^2 + randn(100,1);
% fit the quadratic regression model
mdl = fitlm([x1 x2], y, 'quadratic');
% get the coefficients and their standard errors
coefs = mdl.Coefficients.Estimate;
[~, ~, ~, SE] = coefCI(mdl);
% calculate the standard deviation of the coefficients
SD = SE./3.92; % for a 95% confidence interval
In this example, the coefs variable contains the estimates for the coefficients, and the SE variable contains their standard errors. The SD variable contains the estimated standard deviation of each coefficient.
  댓글 수: 1
padam bahadur karki
padam bahadur karki 2023년 3월 26일
Could you please provide the reference for "SD = SE./3.92"?
I found the equation for SE = (CI upper limit - CI lower limit)./2*1.96.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Regression에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by