Hey Good Day,
I'm using EViews7 and I have organized my time series data using the "Wide +/-" function for a 7-day week (although i'm ignoring Sat and Sun). I'm using daily stock prices of a company. So essentially I have a company's stock prices sorted by weekdays per column all within one workfile (and its important I keep the data presented this way). My question is, is there a way to compute the averages of each column? This way I can achieve my aim of computing the average stock price for a company for mondays, tuesdays etc until fridays then I can subject these means to a hypothesis test.
I tried the "series sum = @sum(x)" in an attempt to sum one column (and then divide later on to get the average) but as you guys would already know it gave me the sum of all the stock prices in my workfile (ie sum of all the columns despite the "by-weekday" presentation of data given by the "Wide +/-" function).
PS- If it can't be done I'll have to copy and paste the data the way it appears in EViews7 into Excel 2007 then use its average function. However Eviews is nicer to work with for my purposes and given that I already started my data analysis in EViews7 it would be nice to be consistent.
Thanking you very much in advance.
Finding (Simple) Average Under the "Wide+/-" Function
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Finding (Simple) Average Under the "Wide+/-" Function
The "Wide +/-" function is for display purposes only. It only changes the way the data are displayed, it does not alter anything about the structure of the data itself.
If you want to find daily averages, you can use the @meansby function with the by-series being @weekday. Thus:
You can also use the @sumsby function in the same way if you want sums.
If you want to find daily averages, you can use the @meansby function with the by-series being @weekday. Thus:
Code: Select all
series mean = @meansby(x, @weekday)
Re: Finding (Simple) Average Under the "Wide+/-" Function
Yeah i figured the "Wide +/-" function only affected the way the data looked. I tried the function you gave and it worked perfectly!
Thanks so much Gareth! Much appreciated!
Thanks so much Gareth! Much appreciated!
Who is online
Users browsing this forum: No registered users and 2 guests
