Page 1 of 1

Change of alpha series into numeric possible?

Posted: Tue Jan 11, 2011 3:44 am
by miret
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!

Re: Change of alpha series into numeric possible?

Posted: Tue Jan 11, 2011 5:43 am
by trubador
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.

Re: Change of alpha series into numeric possible?

Posted: Tue Jan 11, 2011 8:03 am
by startz
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.

Re: Change of alpha series into numeric possible?

Posted: Tue Jan 11, 2011 8:53 am
by EViews Gareth
You might find the @asc function useful. This converts a single letter into an ASCII numeric code.

Re: Change of alpha series into numeric possible?

Posted: Wed Jan 12, 2011 10:14 am
by EViews Glenn
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.