Hi all,
My panel data has N = 745 firms, T = 226 weeks but it is unbalanced. I am following Da, Engelberg and Dao (2011), In Search of Attention, The Journal of Finance.
I want to compute the correlation among several variables as follows: "correlations are first computed in the time series for each stock with a minimum of 1 year of data and then averaged across stocks".
If I do this - by permno, sort : correlate svi log_size log_abs_ret - Stata reports 745 correlation matrices but I don't know how to average each correlation coefficient across all 745 firms and report 1 single matrix. Perhaps this requires coding. In addition, I also don't know how to use [if] so that I ignore firms with a total number of weeks smaller than 52.
Finally, I'd also like to apply that method to several summary statistics (e.g. Q1, Q3, skewness and kurtosis). xtsummarize has the between and within data but this does not give me what I need.
Thank you,
Joao
My panel data has N = 745 firms, T = 226 weeks but it is unbalanced. I am following Da, Engelberg and Dao (2011), In Search of Attention, The Journal of Finance.
I want to compute the correlation among several variables as follows: "correlations are first computed in the time series for each stock with a minimum of 1 year of data and then averaged across stocks".
If I do this - by permno, sort : correlate svi log_size log_abs_ret - Stata reports 745 correlation matrices but I don't know how to average each correlation coefficient across all 745 firms and report 1 single matrix. Perhaps this requires coding. In addition, I also don't know how to use [if] so that I ignore firms with a total number of weeks smaller than 52.
Finally, I'd also like to apply that method to several summary statistics (e.g. Q1, Q3, skewness and kurtosis). xtsummarize has the between and within data but this does not give me what I need.
Thank you,
Joao
Comment