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
Manipulating data in series
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Manipulating data in series
Take a look at the smpl if command. It controls which observations are operated on.
-
- Posts: 6
- Joined: Sat Jun 11, 2011 10:29 am
Re: Manipulating data in series
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.
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.
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Manipulating data in series
By "it" do you mean "newvalue" or "oldvalue?"
-
- Posts: 6
- Joined: Sat Jun 11, 2011 10:29 am
Re: Manipulating data in series
By "it" I mean oldvalue
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Manipulating data in series
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
-
- Posts: 6
- Joined: Sat Jun 11, 2011 10:29 am
Re: Manipulating data in series
Thanks for your reply, where can I insert that code? I'm sorry, but I'm quite new with programs like eviews in general.
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Manipulating data in series
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.
You might want to read the initial chapters of EViews Illustrated, which are available for free at the EViews web site.
-
- Posts: 6
- Joined: Sat Jun 11, 2011 10:29 am
Re: Manipulating data in series
I've been able to figure it out with your advice. Thanks a million!
Who is online
Users browsing this forum: No registered users and 19 guests