Hello,
I am trying to create my own stock market index that is aggregate of all stocks' trade data within a particular stock market. I have multiple markets with multiple stocks in each. Let's say I want to create a series that sums number of all traded stocks (volume) for each trading day. How can I do it in eviews v8.1?
Assume that for market="US" I have series VOL (number of stocks traded for a given day) for stocks X,Y, and Z for dates Date:t, Date:t+1, and Date:t+n.
I need to create a series of US_inx_vol that sums VOL of all stocks for each date (total number of stocks traded for a given day).
If I use excel SUMIF function then I would type =sumif(range of multiple stocks data for a period; Date; VOL) near each Date on the vector.
PS: Also, if it won't complicate it much, how to weight each additional component. In the example above, all stocks have same impact on the index. Is it possible to weight variables by market capitalization before summing? Let's say I want to estimate weighted average of PE ratio for all stocks in a market.
How to create series that sums other series for particular date?
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: How to create series that sums other series for particular date?
Code: Select all
series US_inx_vol= volx + voly + volz
series US_inx_vol = .4*volx + .3*boly + .3*volz
Re: How to create series that sums other series for particular date?
Thank you for such swift reply. Although it is helpful as it clearifies that dates are automatically matched, it is not exactly what I was asking. I have over three thousands stocks in each market and I have dozen markets. It will be very difficult to type one by one each stock in the formula. How can I use SUMIF function for stocks from the same market. Something like: if market="US" then sum VOL. Same for other markets.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to create series that sums other series for particular date?
Code: Select all
series mysum = @sumsby(vol, market)
Follow us on Twitter @IHSEViews
Re: How to create series that sums other series for particular date?
Thank you. That's what I was looking for.
Who is online
Users browsing this forum: No registered users and 25 guests