Change of alpha series into numeric possible?

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

miret
Posts: 4
Joined: Sat Jan 08, 2011 2:09 am

Change of alpha series into numeric possible?

Postby miret » Tue Jan 11, 2011 3:44 am

Hello,

I am doing a panel study and one of my variable is the S&P corporate credit ratings, which takes on values from AAA to D.
EViews has correctly read that as an alpha series.

However, for my analysis I preferred to give those letters a numeric value from 1 to 22 to indicate the strength of a credit rating. EViews appears to continue to identify the variable as an alpha series. Is it possible to switch to a numeric series?

Thank you in advance for any feedback you may have!

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Change of alpha series into numeric possible?

Postby trubador » Tue Jan 11, 2011 5:43 am

Value Maps might be very useful for this purpose. Once you define your value map (i.e. define a valmap object), then you can obtain the numeric values associated with those string labels (i.e. credit scores) using the @unmap function.

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

Re: Change of alpha series into numeric possible?

Postby startz » Tue Jan 11, 2011 8:03 am

Or, write a program something like,

series numeric
numeric = @recode(oldAlpha="AAA",1,NA)
numeric = @recode(oldAlpha="AA",2,oldAlpha)
etc.

Or, conceptually nicer, create a new page with both the old and new variables. Then copy and paste special the new variable into the old page match-merged to the old variable.

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

Re: Change of alpha series into numeric possible?

Postby EViews Gareth » Tue Jan 11, 2011 8:53 am

You might find the @asc function useful. This converts a single letter into an ASCII numeric code.

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

Re: Change of alpha series into numeric possible?

Postby EViews Glenn » Wed Jan 12, 2011 10:14 am

Better yet, try makemap. This will create the numeric series and attach a valmap. You can then work with the numeric series, but view it in valmap form.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests