How can i do a Multiple Linear Regression

6 vues (au cours des 30 derniers jours)
Gabriel Luca Pugliese Borges
Modifié(e) : the cyclist le 27 Mar 2023
Hello everyone, how are you all doing?
I have some variables that i want to correlate to see how they interact.
How can i use the "regress" function being that my variables are Temperature Anomaly, Precipitation Anomaly, River Discharge, Globals Index such as Niño, Atlantic Meridional Mode, South Tropical Atlantic, and more...
where should i put these variables on the function? I tried to see the "help regress" but i still have a lot of lack of understanding. ]
For example, i want to know how the these indexes have impact on the temperature over a specific region.
After that, i want to know the same with the precipitation, sea level...
Thank you.

Réponse acceptée

the cyclist
the cyclist le 27 Mar 2023
Modifié(e) : the cyclist le 27 Mar 2023
My advice would be to try to read and understand the example from the documentation page for regress.
Better yet, I would use the more modern fitlm function, and look at the examples there.
If you stick with regress, then you should put all your explanatory variables into one numeric array called X, and then if you are trying to predict a variable called Temp, then the syntax will be
[b,bint,r,rint,stats] = regress(Temp,X)
The documentation page explains what all of the output means.
If you use fitlm instead, you can set up your variables in the same way, and then the syntax will be
mdl = fitlm(X,Temp)
You will then be able to get the model coefficients, and much more information about the model. It will be more work to understand at first, but important to learn it.

Plus de réponses (0)

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by