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
Transform wide Datastream format to longDear all, For the purpose of my research in which I wish to analyze the effect of buy/sell recommen…
Higher significance levelDeal all, I am running an OLS regression analysis and the significance level is set by default at 1…
counting total of variable based on other variableHello, i want to count the total M&A's (labeled as 1 in maactive) of a firm (based on gvkey) en…
interpolate between two decades using expandHi All, I have two unbalanced panel dataset with different variables in different frequencies. The…
dummy for interaction variables in regressionHi Here I am again i.wealthindex*i.educationlevel === What is the correct stata command / syntha…
Subscribe to:
Post Comments (Atom)
0 Response to Abnormal Returns/ Average return of the market, value-weighted
Post a Comment