How can i do a Multiple Linear Regression

7 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

the cyclist
the cyclist il 27 Mar 2023
Modificato: the cyclist il 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.

Più risposte (0)

Categorie

Scopri di più su Statistics and Machine Learning Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by