Hi,
I have a dataset containing stock quotes and interest rates on a daily basis (5days/week). I wish to calculate the 1month returns to these, and thus need to be able to lag the values of variable by 1 month (and not 30 days or something similar).
Is there any way to do this? I've tried applying a filter through defining a dummy, however lagging 1 period still gives the previous day's quote, not the -1month quote.
Since it's 5day/week data, it automatically needs to sort out the dating, ie. if I want the return in april, I need the first trading day of march (not 1st of march if its a weekend).
To define my dummy for if conditioning to only pick first available day of a month I've defined the following variable: series fd=@iif(@month<>@month(-1), 1, fd(-1)+1)
Best regards, Thomas
One month lag in daily data
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: One month lag in daily data
You'll need to define what a one month lag is...
What is a one month lag on March 31st?
What is a one month lag on March 31st?
-
Thomasms90
- Posts: 15
- Joined: Wed Mar 20, 2013 7:14 am
Re: One month lag in daily data
That would be 28(29th) february. Basically the last day the previous month. We are using first days each month tho.. Still, if for instance we are looking at return 1. april, the 1 month lag would be 1. march. However if that's a sunday, we would want the day from 2. march.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: One month lag in daily data
I'm slightly confused. You have to come up with a structured rule for how you treat days that don't exist. February 31st doesn't exist, so you state you go backwards in time to the previous available date (Feb 28th). But then you say that if March 1st doesn't exist as a one month lag for April 1st, then you want to go forwards in time to March 2nd.
Thus what is the rule?
Thus what is the rule?
Who is online
Users browsing this forum: No registered users and 2 guests
