recoding/modifying a variable

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

vasco1966
Posts: 6
Joined: Fri Aug 23, 2019 5:55 am

recoding/modifying a variable

Postby vasco1966 » Tue Feb 14, 2023 4:09 am

Hi:

I would like to reduce the number of ordered categories in my dependent variable. How do I do that with Eviews13?

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

Re: recoding/modifying a variable

Postby EViews Gareth » Tue Feb 14, 2023 7:59 am

How would you like to do it?
Follow us on Twitter @IHSEViews

vasco1966
Posts: 6
Joined: Fri Aug 23, 2019 5:55 am

Re: recoding/modifying a variable

Postby vasco1966 » Tue Feb 14, 2023 8:30 am

My dependent variable has 11 categories (0-10). I would like to combine categories 0-3, 4-6, and 7-10

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

Re: recoding/modifying a variable

Postby startz » Tue Feb 14, 2023 10:04 am

vasco1966 wrote:My dependent variable has 11 categories (0-10). I would like to combine categories 0-3, 4-6, and 7-10


Code: Select all

series new = @recode(@inlist(old, "0 1 2 3"),1,NA)
new = @recode(@inlist(old, "4 5 6"),2, new)
new = @recode(@inlist(old, "7 8 9 10"),3, new)


Haven't tried, but I think it will work.

vasco1966
Posts: 6
Joined: Fri Aug 23, 2019 5:55 am

Re: recoding/modifying a variable

Postby vasco1966 » Tue Feb 14, 2023 4:20 pm

Thank you for your help. Will try it and will let you know


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 22 guests