How can i do a Multiple Linear Regression

조회 수: 7 (최근 30일)
Gabriel Luca Pugliese Borges
Gabriel Luca Pugliese Borges 2023년 3월 27일
편집: the cyclist 2023년 3월 27일
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.

채택된 답변

the cyclist
the cyclist 2023년 3월 27일
편집: the cyclist 2023년 3월 27일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by