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!
Change of alpha series into numeric possible?
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
Re: Change of alpha series into numeric possible?
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?
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.
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?
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?
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.
Who is online
Users browsing this forum: No registered users and 2 guests
