Dear forum,
since this is my first post here and since I am new to Stata, I hope my post fulfills the forum requirements. I want to calculate the pairwise correlations across the (abnormal) returns of 80 firms,
for an event study test statistic and I need the average over all these pairwise correlations. I have read that I might achieve what I intend by using a loop, however I am unable to program
such a loop unfortunately. In the last clumn i have stored a value I also need to construct the test statistic, but for the correlations that value is irrelevant.
Below you can find an excerpt of my data. Any help would be highly appreciated!!
Jonas
input long Date float(resid_MarketModel_1 resid_MarketModel_2 resid_MarketModel_3 BMP_t)
22715 .028857823 -.012030476 .011276288 -17.066809
22718 .001680778 .015519869 .04662051 -17.066809
22719 -.013552702 -.0013050697 -.010423742 -17.066809
22720 .011290512 .0247944 .022345623 -17.066809
22721 -.017967667 .0013580762 -.02512785 -17.066809
22722 -.009187383 -.011011245 -.0087083 -17.066809
22725 .003578504 -.0034927686 -.00557095 -17.066809
22726 -.005407726 .010930496 .006511768 -17.066809
22727 -.013838122 -.01001027 -.015077838 -17.066809
22728 -.00786587 -.006517837 -.007176251 -17.066809
22729 .0239404 .003767889 .027022535 -17.066809
22732 -.011907137 -.014157334 -.02665999 -17.066809
22733 .005552202 -.008957997 -.009840348 -17.066809
22734 -.023531053 .00018480085 -.02001087 -17.066809
22735 .0040255897 -.017226135 -.009717827 -17.066809
22736 -.014861178 -.010953325 -.007508885 -17.066809
22739 -.012034866 -.003144226 -.01649329 -17.066809
22740 -.0007985968 -.001498356 .007198072 -17.066809
22741 -.0037047905 -.006126278 -.0025296016 -17.066809
Related Posts with Calculate average of the (pairwise) sample cross-correlations
ARDL modelHow to estimate a ARDL model with interaction variables ? First, i used the PCA method to generate t…
Unconditional cross-nested 4-level modelDear all, I would like to replicate a paper (https://onlinelibrary.wiley.com/doi/10.1002/smj.3057) …
How to Modify Stata Data (Dta file) using python code and save changes back to the dta fileI have 2000 observations and 100 variables in my data from an empirical research project. I am curre…
Dropping observations based on a list of IDHello, Is there a way to drop observations using a list of IDs ? I have a dataset and there are sev…
By ID_number, keep registry-based (baseline=0) test dates obtained 1 year after original (baseline=1) study’s test dateReally need help! With the expert guidance of a statistician, I merged (using the append command) a …
Subscribe to:
Post Comments (Atom)
0 Response to Calculate average of the (pairwise) sample cross-correlations
Post a Comment