How to determine standard error from Multiple Linear Regression
6 次查看(过去 30 天)
显示 更早的评论
Getting the standard error from regress.
If I have # of equations of the following format
Y = A*Z1 + B*Z2
and I have # of Y, Z1 and Z2 values.
I did a mulitple linear regress to determine the A and B value using the following script.
Y = importdata('C:\Users\Calvin\Desktop\FYP\Regression Script\Y.mat');
Z = importdata('C:\Users\Calvin\Desktop\FYP\Regression Script\Z.mat');
% Multiple Linear Regression to find the coeeficients A, B, C
W = regress(Y,Z);
A = W(1);
B = W(2);
Question: Is there any way I'm able to obtain the error standard error for A and B, ±ΔA & ±ΔB.
Thank you in advance!
0 个评论
采纳的回答
Iddo Weiner
2016-11-30
Hi calvin,
If I understood you correctly - what you're looking for is the second output of regress(), which is a confidence interval. Check out the documentation for more info on how this works.. In general - it gives you a symmetrical zone around your regressor which can be regarded as the errors you refer to (although this isn't exactly a standard error).
Run this short simulation to take a closer look. I tried to keep the same variable names as in your example, so: W is the vector storing the regressors and CI, the second requested output of regress, is the confidence interval.
Y = (1:100)';
Z = randi(100,[100,2]) % get (100,2) random numbers
[W, CI] = regress(Y,Z); % get the regressors and their corresponding confidence intervals
% visualize results
figure
bar(W,'w')
xlim([0 3])
hold on
errorbar(W,[CI(1,2)-W(1), CI(2,2)-W(1)],'pr')
legend('regressor','95% C.I.','safdsad')
set(gca,'XTickLabel',{'W1','W2'})
hold off
{ If this does not answer your question, please provide: (1) the actual data you're working with and (2) a more detailed explanation of what you are looking for }
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!