I want to generate a 5 year (min 3 years) rolling Spearman correlation. I have come with the following codes:
Code:
1. rangestat (corr) x1 x2, int(fyear 0 -4) by(firm_id) 2. tsset firm_id fyear rolling correlation=r(rho), window(5) saving(f2, replace): corr x1 x2
Can you suggest me any alternative way in terms of using minimum window requirement and speed of execution?
Best regards,
Alberto
0 Response to Rolling window Spearman correlation
Post a Comment