フィルターのクリア

Multiple linear regression coefficient calculation

5 ビュー (過去 30 日間)
Priyanka Nehra
Priyanka Nehra 2020 年 8 月 24 日
コメント済み: Priyanka Nehra 2020 年 8 月 26 日
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.

回答 (1 件)

J. Alex Lee
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
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.
Priyanka Nehra
Priyanka Nehra 2020 年 8 月 26 日
Got it. Thanks

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

Community Treasure Hunt

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

Start Hunting!

Translated by