Control for Confounding Variables in a Linear Regression Model
Show older comments
Hi All,
I am trying to fit a multiple linear regression model to my data using the function fitlm(x) and I'm wondering how to go about controlling for some confounding variables in the model, and later the prediction of my dependent variable. Are there different possibilities to do so? I was using the regress(x) function ro regress out the confounding variables & then using the residuals of the independent variables to fit the model. I'm not sure if that's the correct approach and I'm thankful for any suggestions and input!
Thanks,
Johanna
Accepted Answer
More Answers (0)
Categories
Find more on Linear and Nonlinear Regression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!