Hi everyone,
I have a complete dataset from 1992-2012 of stock prices. I want to calculate the returns of these stock prices for different samples. Let's say for the sample from 1994-2008. If I set the sample to these years then I will also automatically receive a return for January 1st 1994, because the range of my dataset does include data for December 31st 1993. Therefore eViews is able to calculate a return for January 1st 1994. Actually quite convenient, but in my special case not useful, because I want the first return to be calculated on January 2nd 1994, since only from January 2nd on all data needed to calculate the returns are in the sample. Of course I could just delete the return on January 1st manually, but since I will have different samples to consider, it would be quite annoying to do so every time. So, is there a way to let eViews know, that returns are only to be calculated based on the data in the sample and not based on the data in the sample and on the last day before the sample starts?
Thanks for suggestions.
Bests
Neptunhiker
sample problem - ignore first observation
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
neptunhiker
- Posts: 50
- Joined: Sat Oct 20, 2012 7:30 am
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: sample problem - ignore first observation
Without knowing more specifics as to what you're actually trying to do, the only thing I can suggest is copying the data to a new page each time.
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3798
- Joined: Wed Sep 17, 2008 2:25 pm
Re: sample problem - ignore first observation
Perhaps calculate the full set of returns, and then set the sample to begin one day later than otherwise for the analysis.
-
neptunhiker
- Posts: 50
- Joined: Sat Oct 20, 2012 7:30 am
Re: sample problem - ignore first observation
Hi startz,
that's a good idea, but unfortunately does also include the disadvantage, that I lose one observation of stock prices, which I also want to work with. But thanks anyways for your help.
Hi EViews Gareth,
copying the data to a new page will definitely work, but that would probably not reduce the work compared to just deleting the first return for each sample. You asked for more specifics. Well, I want to calculate the mean return for different sample periods, but since each return can by definition only be calculated, when there are at least two observations, the first return should be calculated for the movement of the stock from day 1 to day 2 of the sample period. EViews though uses the last day before the start of the first day of the sample period to calculate a return for the movement of the stock from that last day to day 1 of the sample period. And that's what I would like to prevent. I'm sorry, if I explained myself again, but I am not sure what kind of specifics you are asking for. Thanks a lot.
that's a good idea, but unfortunately does also include the disadvantage, that I lose one observation of stock prices, which I also want to work with. But thanks anyways for your help.
Hi EViews Gareth,
copying the data to a new page will definitely work, but that would probably not reduce the work compared to just deleting the first return for each sample. You asked for more specifics. Well, I want to calculate the mean return for different sample periods, but since each return can by definition only be calculated, when there are at least two observations, the first return should be calculated for the movement of the stock from day 1 to day 2 of the sample period. EViews though uses the last day before the start of the first day of the sample period to calculate a return for the movement of the stock from that last day to day 1 of the sample period. And that's what I would like to prevent. I'm sorry, if I explained myself again, but I am not sure what kind of specifics you are asking for. Thanks a lot.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: sample problem - ignore first observation
That's a somewhat confusing reply.Hi startz,
that's a good idea, but unfortunately does also include the disadvantage, that I lose one observation of stock prices, which I also want to work with. But thanks anyways for your help.
Say you have five observations of data. Lets call them T1, T2, T3, T4 and T5.
You want to calculate the return, which is a calculation, you say, based upon two observations of data. Thus you can calculate four data points - One for (T1,T2), one for (T2,T3), one for (T3,T4) and one for (T4,T5). I'm going to assume (although this is just a guess on my behalf), that you want those calculations to be the values for the second data point in the pair. i.e. you can calculate return data for T2, T3, T4 and T5.
Now, you want to set the sample to be observations T3, T4 and T5. You, correctly, point out that EViews will happily calculate data points for the returns for those three observations, and it will do so by using data from T2 for the T3 calculation.
You say you don't want EViews to use data in T2 though. Thus you only want to use data in T3, T4 and T5 for the calculations, which means you can calculate returns for only T4 and T5. To do that, Startz's suggestion works well - simply set the sample to be periods T4 and T5. Then you get what you want.
But you say that doesn't work because you've lost a period. Well, have you? Sure, you've lost period T3. But you also said that you didn't want to use T3 because the calculation uses data from T2. So how can you both want to use T3 and not want to use T3?
-
neptunhiker
- Posts: 50
- Joined: Sat Oct 20, 2012 7:30 am
Re: sample problem - ignore first observation
Hi EViews Gareth,
you claryfied the problem correctly. I would like to calculate returns using the data of the sample of T3, T4 and T5. If I set the sample to T3-T5 I will get return data for T3, T4 and T5. That's exactly what I would like to prevent. Following Startz suggestion and setting the sample to T4-T5, I will "trick" eViews and only receive return data for T4 and T5. Perfect, but perfect only for the return calculation of my data. Since the return calculation is only part of my analysis, I would rather find a different solution, because other analysis is supposed to include data for T3. That is the reason why I both want to use T3 and not want to use T3.
you claryfied the problem correctly. I would like to calculate returns using the data of the sample of T3, T4 and T5. If I set the sample to T3-T5 I will get return data for T3, T4 and T5. That's exactly what I would like to prevent. Following Startz suggestion and setting the sample to T4-T5, I will "trick" eViews and only receive return data for T4 and T5. Perfect, but perfect only for the return calculation of my data. Since the return calculation is only part of my analysis, I would rather find a different solution, because other analysis is supposed to include data for T3. That is the reason why I both want to use T3 and not want to use T3.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: sample problem - ignore first observation
There's no other way around it. You'll have to use one sample when performing analysis on returns, and another sample when performing analysis on other series.
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3798
- Joined: Wed Sep 17, 2008 2:25 pm
Re: sample problem - ignore first observation
To add to Gareth's comment, this isn't really an EViews issue. In most any standard statistical procedure you need to have the same sample for all the data.There's no other way around it. You'll have to use one sample when performing analysis on returns, and another sample when performing analysis on other series.
Who is online
Users browsing this forum: No registered users and 2 guests
