How to do a yearly regression?
Afficher commentaires plus anciens

Hello,
We have accounting data from 2010 - 2020, and want to do one regression year by year such as showed above.
The photo below shows how our data is displayed. Hope someone can help.

Réponses (1)
Shreeya
le 22 Sep 2023
I understand you want to perform an year wise regression on the this dataset. You can follow the below steps to achieve this
- Import the dataset to the MATLAB workspace into a variable called "trainingData".
- Inside a "for" loop, index the dataset to seperate the data of all the years. For example:
trainingData2010 = trainingData(trainingData.year == 2010,:);
- You can then use the Regression Learner App to perform regression tasks on the seperated dataset. Refer to the link below regarding the usage of the App: https://www.mathworks.com/help/stats/regression-learner-app.html
I hope this is helpful in addressing your query.
Catégories
En savoir plus sur Linear Regression dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!