Page 1 of 1

Replace Alphavalues

Posted: Mon Mar 10, 2014 3:39 am
by student_m
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

Re: Replace Alphavalues

Posted: Mon Mar 10, 2014 8:21 am
by EViews Gareth

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.

Re: Replace Alphavalues

Posted: Thu Mar 13, 2014 6:22 am
by student_m
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?

Re: Replace Alphavalues

Posted: Thu Mar 13, 2014 8:09 am
by EViews Gareth

Code: Select all

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