Replace Alphavalues

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

student_m
Posts: 5
Joined: Tue Feb 11, 2014 7:12 am

Replace Alphavalues

Postby student_m » Mon Mar 10, 2014 3:39 am

Hi,

I have an alpha series consisting of NAICS(north american industry classification system) codes, such as '63', '74' etc.

I am doing a study on industries, and it is possible to divide all the NAICS codes into 9 different industries.

My question is how can I replace the different NAICS codes with industry codes? Say that I want '63', '64', '65' and '66' to be renamed into 'manufacturing', or a single number making it easier to identify the industry?

I have tried @replace, but I do not know how I can add several NAICS into one joint number or industry.

I have tried:

alpha industry = @recode(naics, "63", "1")

which works, but what do I do when I want '63', '64', '65' and '66 to be renamed into '1' as well, and in addition '72', '73' and '74' renamed into '2'

I am using Eviews 7

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

Re: Replace Alphavalues

Postby EViews Gareth » Mon Mar 10, 2014 8:21 am

Code: Select all

smpl if naics="63" or naics="64" or naics="65" alpha industry = "Manufacturing" smpl if naics="72" or naics="73" industry = "Textiles"
In EViews 8 you can use the @inlist function to make it a bit easier.

student_m
Posts: 5
Joined: Tue Feb 11, 2014 7:12 am

Re: Replace Alphavalues

Postby student_m » Thu Mar 13, 2014 6:22 am

Thanks!

Follow up question; How do I add a time interval for the command? For example, if I only want to replace for the periode 2002 - 2006, when my total sample is from 2000 to 2010?

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

Re: Replace Alphavalues

Postby EViews Gareth » Thu Mar 13, 2014 8:09 am

Code: Select all

smpl 2002 2006 if naics="72" or naics="73"


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest