Multiple linear regression coefficient calculation
8 次查看(过去 30 天)
显示 更早的评论
Hello,
I want to perform regression on three indepndent variables (x1, x2, x3 ) and one dependent variable (y). To perform y= b0+ b1.x1+b2*x2+ b3*x3 I need to calculate coefficient value b0 to b3. For which I am using b = regress(y,X). how to evaluate X using x1,x2,x3.
0 个评论
回答(1 个)
J. Alex Lee
2020-8-24
Assuming your data are in rows (y is a column vector), isn't that just
X=[ones(size(x1)),x1,x3,x3]
see
3 个评论
J. Alex Lee
2020-8-24
do you have nan's in your x1, x2, x3, or y? how many observations do you have? you need at least 4 and possibly more in case of degeneracy.
另请参阅
类别
在 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!