Page 1 of 1

How to create subsamples by date in batch?

Posted: Fri Jan 22, 2021 7:55 am
by nsea411
Dear friends,

Now I have a time series contains daily stock price data from 2000/1/1 to 2020/12/31, what I want is to create 240 monthly subsamples(for example, use the daily data of 2000m01 to create the first monthly subsample, use the daily data of 2000m02 to create the second monthly subsample and so on).
I know the command of creating subsamples is "smpl" but I don't know how to create these subsamples in batch because I'm very new to Eviews programming, if anyone can help me, I will be greatly grateful(I'm using E10).

Thank you in advance!

(P.S. Because of the time difference, I may not reply immediately, please forgive me.)

Re: How to create subsamples by date in batch?

Posted: Fri Jan 22, 2021 9:12 am
by EViews Gareth

Code: Select all

for !i=1 to 240 smpl 2000m1+!i-1 2000m1+!i-1 next

Re: How to create subsamples by date in batch?

Posted: Fri Jan 22, 2021 2:50 pm
by nsea411
Thank you, sir. You've really helped me a lot and I'll try.

Re: How to create subsamples by date in batch?

Posted: Fri Jan 22, 2021 8:59 pm
by nsea411

Code: Select all

for !i=1 to 240 smpl 2000m1+!i-1 2000m1+!i-1 next
Sorry to disturb you again, I also want to know how to generate a corresponding series after generating subsamples? For example, after generating 240 stock price subsamples, 240 new stock price series are also generated. Thank you again for your help!

Re: How to create subsamples by date in batch?

Posted: Mon Jan 25, 2021 2:31 pm
by EViews Matt
Hello,

You can include a series statement in the for loop to create the series, but the details will depend on how you want to name and optionally initialize the series (???).

Code: Select all

for !i=1 to 240 smpl 2000m1+!i-1 2000m1+!i-1 series ??? = ??? next

Re: How to create subsamples by date in batch?

Posted: Mon Jan 25, 2021 7:35 pm
by nsea411
Hello,

You can include a series statement in the for loop to create the series, but the details will depend on how you want to name and optionally initialize the series (???).

Code: Select all

for !i=1 to 240 smpl 2000m1+!i-1 2000m1+!i-1 series ??? = ??? next
Thank for your answer very much, Matt. I have created corresponding series in another way, which you might have seen in my another post(doing it my way creates new problems, and you've helped me again).