Hi everyone.
I am trying to generate abnormal returns in STATA.
To do so, I need to calculate the expected returns (Expected return = α+β*R)
R is the average return of the market, for which I want to do a value weighted calculation (with returns and market capitalization)
I have a dataset with around 550 companies and for each company I have more than 300 daily returns and the associated market cap for the day.
I was able to calculate the average market return for one day by doing the following:
egen num=total(QJ*QK)
egen den=total(QJ)
gen wtmean=num/den
My Variables are named from QJ, QK, QL,...,ATI.
QJ is daily market cap, QK daily return
QL is daily market cap, QM daily return
and so on (every second variable is market cap)
I want to create wtmean for every day and then calculate the mean, so that I have the average return for the market for the time period I am looking at.
Can anyone help me on how to create the average return for the market? I already tried foreach but I didn't find the right code, as I don't know how to address only every second variable.
Related Posts with Abnormal Returns/ Average return of the market, value-weighted
Firm and Industry Effects Together?Hi, In the context of corporate finance, some studies claim to use firm and industry fixed effects …
Variable not found in nlcomDear Everyone, I'm new here and I would like to measure willingness to pay by using double bounded …
Pooled olsHi all, I am trying to add corrections for year (year-count variable) and units (countries) when ru…
variable names as elements?Dear All, I find this question here. The data is Code: * Example generated by -dataex-. To install…
stataHello . I selecting the excell file. then import the following code in stata gen area=substr( ADDRES…
Subscribe to:
Post Comments (Atom)
0 Response to Abnormal Returns/ Average return of the market, value-weighted
Post a Comment