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
Calculating Additional Goodness of Fit indices for a GSEM containing PoissonI'm in the process of trying to obtain additional goodness of fit indices besides the AIC and BIC fo…
Svyset command "unrecognized" in Stata 15Hi everyone, I have a puzzling problem. I'm using Stata 15 and when I try to svyset, I get an error…
In SEM, calculating SE of standardized total effects and indirect effectsI'm fitting a SEM model, and everything is fine except the paper's reviewers want standardized total…
Reshape wide errorI'm using Stata 15.1 on a Windows 10 machine I'm struggling to get my head around -reshape- (again)…
How does Stata select bootstrap samples?If I understand it correctly, when using the -vce(bootstrap)- command for a regression, Stata will r…
Subscribe to:
Post Comments (Atom)
0 Response to Abnormal Returns/ Average return of the market, value-weighted
Post a Comment