How fill a series with a specific range of numbers

For questions regarding programming in the EViews programming language.

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

hirastikanah
Posts: 8
Joined: Mon Apr 08, 2013 12:23 pm

How fill a series with a specific range of numbers

Postby hirastikanah » Tue Jun 09, 2015 1:13 am

Hello
How can I fill a series without typing every single number?
For example :
I have a blank Series named a.
I can use the code a.fill 10,11,12,13,14,15
Is it possible to fill it somehow from 10 to 15 without typing the numbers one by one?

Thanks in advance

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: How fill a series with a specific range of numbers

Postby EViews Glenn » Tue Jun 09, 2015 11:27 am

There are a variety of ways to do this depending on the exact values that you wish to use. The best method depends on the context. You'll have to provide exact details on your workfile structure, and the values you wish to use in initializing the series.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: How fill a series with a specific range of numbers

Postby EViews Gareth » Tue Jun 09, 2015 2:19 pm

Look up series.adjust in the object reference.

hirastikanah
Posts: 8
Joined: Mon Apr 08, 2013 12:23 pm

Re: How fill a series with a specific range of numbers

Postby hirastikanah » Wed Jun 10, 2015 10:37 am

Hello again
Looking up for series.adjust didn't help.

I would like to fill a series with integer numbers start from 10 for instant to 15... Without typing them one by one 10,11,12,13,14,15

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: How fill a series with a specific range of numbers

Postby EViews Glenn » Wed Jun 10, 2015 1:13 pm

Code: Select all

series y = @trend+10
and if there are only 6 observations in the workfile

Code: Select all

series y y.adjust = 10 .. 15 ^
The latter linear interpolates between the first observation and the last in the current sample using the endpoint values.

hirastikanah
Posts: 8
Joined: Mon Apr 08, 2013 12:23 pm

Re: How fill a series with a specific range of numbers

Postby hirastikanah » Thu Jun 11, 2015 5:08 am

Code: Select all

series y = @trend+10
and if there are only 6 observations in the workfile

Code: Select all

series y y.adjust = 10 .. 15 ^
The latter linear interpolates between the first observation and the last in the current sample using the endpoint values.
THANK YOU SO MUCH

one more question:
the workfile has 20 observations
to fill from the first one to the 6th one with numbers 10,11,12,13,14,15
series y=@trend+10 is great here but how can i stop it on sixth observation?

thanks again

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: How fill a series with a specific range of numbers

Postby EViews Glenn » Thu Jun 11, 2015 10:58 am

Set a restricted sample

Code: Select all

smpl @first @first+5 series y = @trend+10 smpl @all

hirastikanah
Posts: 8
Joined: Mon Apr 08, 2013 12:23 pm

Re: How fill a series with a specific range of numbers

Postby hirastikanah » Thu Jun 11, 2015 11:59 pm

Set a restricted sample

Code: Select all

smpl @first @first+5 series y = @trend+10 smpl @all
thaaaaaaaaaaaaaaaanks :D


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests