Manipulating data in series

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

rogierhanselaar
Posts: 6
Joined: Sat Jun 11, 2011 10:29 am

Manipulating data in series

Postby rogierhanselaar » Sat Jun 11, 2011 11:14 am

Hi there,

My question is two-fold: I have different series with large amounts of data, and (1) I want to put these through a formula. However, this formula has a certain domain; (2) only the values in its domain are to be entered in the formula, while the values lower than the domain are to be set to 0 and the values higher than the domain are to be set to 11. Can someone provide me with some guidance on how to achieve this? I'd much appreciate it.

Best,
Rogier

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

Re: Manipulating data in series

Postby startz » Sat Jun 11, 2011 11:17 am

Take a look at the smpl if command. It controls which observations are operated on.

rogierhanselaar
Posts: 6
Joined: Sat Jun 11, 2011 10:29 am

Re: Manipulating data in series

Postby rogierhanselaar » Sat Jun 11, 2011 11:57 am

I think I've found the button you mentioned. How can i proceed from here?
I want to have each value from the series transformed according to the formula "newvalue = -119 +21*oldvalue^2 -34*oldvalue" if it lies within the interval [3,11]. For the values smaller than 3 I'd like them to become 0 and for the values larger than 11 I'd like them to become 11.

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

Re: Manipulating data in series

Postby startz » Sat Jun 11, 2011 12:06 pm

By "it" do you mean "newvalue" or "oldvalue?"

rogierhanselaar
Posts: 6
Joined: Sat Jun 11, 2011 10:29 am

Re: Manipulating data in series

Postby rogierhanselaar » Sat Jun 11, 2011 1:24 pm

By "it" I mean oldvalue

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

Re: Manipulating data in series

Postby startz » Sat Jun 11, 2011 2:54 pm

Something like

Code: Select all

series newvalue = 0
smpl if oldvalue >=3 and oldvalue<=11
newvalue = whatever
smpl if oldvalue > 11
newvalue = 11
smpl @all

rogierhanselaar
Posts: 6
Joined: Sat Jun 11, 2011 10:29 am

Re: Manipulating data in series

Postby rogierhanselaar » Mon Jun 13, 2011 5:42 am

Thanks for your reply, where can I insert that code? I'm sorry, but I'm quite new with programs like eviews in general.

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

Re: Manipulating data in series

Postby startz » Mon Jun 13, 2011 7:01 am

Just type the commands in the command pane.

You might want to read the initial chapters of EViews Illustrated, which are available for free at the EViews web site.

rogierhanselaar
Posts: 6
Joined: Sat Jun 11, 2011 10:29 am

Re: Manipulating data in series

Postby rogierhanselaar » Mon Jun 13, 2011 9:37 am

I've been able to figure it out with your advice. Thanks a million!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 19 guests