Error in Sample

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

maragloria
Posts: 105
Joined: Tue Jun 29, 2010 7:09 am

Error in Sample

Postby maragloria » Thu Feb 02, 2012 9:34 am

Hi there,

I'am working with weekly data and I would like to set 5 different samples in program but I'm getting the error message

Error in Sample: Illegal date REG1 in "SMPL REG1 4/25/2003 7/13/2007"

I've trying to set the sample in different ways but none worked:

smpl reg1 4/25/2003 7/13/2007
smpl reg1 "4/25/2003" "7/13/2007"

smpl reg1 25/4/2003 13/7/2007

The date in my workfile is displayed as "1/04/1980 12/28/2012 -- 1722 obs"

I'm using Eviews 7.2

Thanks for your help

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: Error in Sample

Postby startz » Thu Feb 02, 2012 10:57 am

Just delete "reg1"

maragloria
Posts: 105
Joined: Tue Jun 29, 2010 7:09 am

Re: Error in Sample

Postby maragloria » Thu Feb 02, 2012 11:24 am

I am gonna give my solution just in case someone else have the same problem

I would like to set 5 sample sets, each representing a different regime, named reg1 to reg5.

My error was using the word "smpl" to name the sample. I had to use "sample" instead.
I didn't notice the nuance before.

So, I should be doing (the double quotes around the dates do not matter):

Code: Select all

sample reg1 4/25/2003 7/13/2007 sample reg2 "7/20/2007" "8/29/2008" sample reg3 "9/5/2008" "3/6/2009" sample reg4 "3/13/2009" "2/25/2011" sample reg5 "3/4/2011" "1/27/2012" for !i=1 to 5 smpl reg{!i} freeze(pca_reg{!i}, mode=overwrite) pca_group.pcomp(cov=corr,out=table) next


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests