Manipulating sample

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

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

Zividodo
Posts: 2
Joined: Tue Nov 16, 2010 2:44 am

Manipulating sample

Postby Zividodo » Tue Nov 16, 2010 2:56 am

Hello,

I have a sample in which any cell can obtain values between 1 and 4. I would like to change the values 1,3 and 4 into 0 and the value 2 into 1. Can anyone please give me a hint? I use Eviews 6.0

Thanks!

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

Re: Manipulating sample

Postby startz » Tue Nov 16, 2010 7:44 am

@recode

Zividodo
Posts: 2
Joined: Tue Nov 16, 2010 2:44 am

Re: Manipulating sample

Postby Zividodo » Tue Nov 16, 2010 1:56 pm

thank you, but how can use this command exactly?

lets assume, the initial variable is called X and I want to generate a new variable Z in order to obtain only values with 0 and 1. would then the command be

genr z = @recode (X=2, 1, 0)

?

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

Re: Manipulating sample

Postby EViews Glenn » Sat Nov 27, 2010 3:18 am

The manual should be pretty clear about how to use @recode. Since you only have 4 values that your original series can take, that should do what you want. Values of X equal to 2 are mapped to 1, and all others to 0.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests