Hey everyone,

For my thesis I am following the methodology from Dittmar & Lundblad (2017) to obtain firm-level consumption risk exposures. Currently I am stuck. The next step would be to obtain time series portfolio betas as they do on the last paragraph on P. 332 of their Paper "Firm characteristics, consumption risk, and firm-level risk exposures".
I do have the aggregated average portfolio returns and the innovation to consumption growth variable. However I do not know to proceed from there on. In their paper they estimate the coefficients (betas) by using "returns and consumption growth from December 1954 trough June 1983, and they expand the window of estimation through December 2012, yielding a panel of 119 quarters of risk exposures for 55 portfolios." (Dittmar & Lundblad, 2017).
I believe that some kind of looping is necessary but I am not sure since the underlying statistics is not really clear to me.

My sample spans from 1965 until 2020 and is quarterly (Year_Quarter, eg: 1965q1).

I would appreciate if one of you guys could tel me what code to use for that step (the specific variable names are not important as they can be changed by me) and how to store the coefficiants as a variable afterwards.

I really appreciate your help as I do not know how to proceed with my thesis otherwise.

Best regards,
Jesse