0

I have a example stata file in this link: http://yunpan.cn/cLVEmBxX6RZYZ Password:90fa

I want to caluculate the market value weighted price in Stata and I have already thought about some codes, but I still do not know how to get my result. This is my code.

    egen company=group(ISINnumber)

sum company

local c=r(max)

gen PM=Aprice*Amarketvalue

forvalues i=1/1303 {
forvalues n=1/`c'  {
local PMprice`n'`i'=PM if company==`n' & week==`i'
}
}
  • Did you know there is a special site for statistics? http://stats.stackexchange.com/ – hgoebl Nov 07 '15 at 09:51
  • It's better to post example data with the question. External sources (a) oblige posters to do more work (b) may not remain accessible indefinitely. That's for your future questions: as flagged, weighted market prices are already an example in another thread. – Nick Cox Nov 07 '15 at 13:27
  • @hgoebl This question would be judged off-topic on Cross Validated given its exclusive focus on Stata code. – Nick Cox Nov 07 '15 at 13:29

0 Answers0