Appreciate the help I've been getting, but have it a new snag.
Series M is the date of each observation. E.g. 1993-08-26
I can't seem to figure out a way to extract just the month from this series, in a 1 to 12 format. Which I can use in the following FOR/NEXT loop.
(The actual year part in loop runs smoothly. It's just when I try creating a month control variable the loop fails- I get NA values instead).
for !year= 1993 to 2001
smpl if yr = !year
for !month= 1 to 12
smpl if M=!month
series Q1=@sumsby(q, collector_ser)
next
next
TIA, B
FOR loops and @month headache
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: FOR loops and @month headache
Does M contain the full date or just the month?
Re: FOR loops and @month headache
M contains the full date. I can't seem to find a function/syntax that extracts just the month infoDoes M contain the full date or just the month?
Re: FOR loops and @month headache
Got it, sorry, where date is the original date series
M=@datepart(date, "mm")
M=@datepart(date, "mm")
Who is online
Users browsing this forum: No registered users and 2 guests
