repeat regression to access betas and T test results

1 view (last 30 days)
hi,Im quite new with Matlab and currently work on a project, which requires me to run two kinds of regressions 100 times for 100 companies. The time frame is 20 years and its in monthly basis(100 (row)*240(column) data). Two regressions are: "y=a+ b x" and "y=a+ b x+ c x^2" and the size of this independent variable: x is 1*240. What I need is both coefficient b from the first regression and coefficient c from the second regression , and their t-stat results . Can I ask how I can write this code in matlab? Many thanks.

Answers (1)

the cyclist
the cyclist on 12 Aug 2015
If you have access to the Statistics and Machine Learning Toolbox, then I recommend using the fitlm command.
  1 Comment
Mandy Guo
Mandy Guo on 12 Aug 2015
hi,I understand I can use fitlm function. However, I just feel quite confused about how to loop these coefficients and t test results in another variable because fitlm function actually returns me 100 tables.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!