各位大佬,目前我正在做股票的beta回归分析,样本是2011-2017年100支股票的monthly return,以及市场的monthly return,现在需要每3年对100个公司各进行一次回归,求出各公司的beta值,也就是2011-2013年对100个公司各进行一次回归,然后2012-2014再进行,以此类推。之前看论坛里有大佬用 bys year industry reg进行逐年按行业回归,请问如何修改代码,可以使窗口期满足3年呢,编程小白,请求各位帮助一下,万分感谢!
Sorry for using English.
Thanks for your feedbacks
But I am confused why date variable turns into different values, I have already set the date format in Excel.