How can I compute regression coefficients for three or more predictor variables?
3 views (last 30 days)
Show older comments
How can I obtain the coefficients (b) of multiple linear regression between mean free joint angles (ankle, hip, knee angles time-normalised to 101 data points) as predictor variables (X = x1, x2, x3) and changes in the mean-free foot COM as an outcome variable (y)
0 Comments
Accepted Answer
Star Strider
on 28 Aug 2012
Edited: Star Strider
on 28 Aug 2012
Assuming your expression is:
y = X * B
where B is the parameter vector, the easiest way to calculate B is:
B = X\y;
Also see regress, since it provides statistics on the fit and confidence intervals on the estimated parameters.
6 Comments
Star Strider
on 6 Sep 2012
Edited: Star Strider
on 6 Sep 2012
As I mentioned in my response in your other thread —
1. I created my example code as an illustration that you could indeed have two dependent variables and regress them against your independent variables. You do not have to calculate Y if you have already defined it with your data as your matrix of dependent variables.
2. It should give you your coefficients in a [4 x 2] matrix as I have it coded here.
3. Yes.
Multiple linear regression is appropriate if your model assumes a linear relationship between the independent and dependent variables. If that assumption is not valid, you will likely have to use a nonlinear regression model.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!