Hi all,
I have a string variable splti in data set that denotes the credit rating of a firm's debt. This rating variable can take values such as "AAA" "A" etc, see below.
I want to have a dummy variable LowRate set equal to 1 if the debt rating is below investment grade , which includes ratings such as "BBB-", "CC","CCC","CCC+", "CCC-","D", "SD".
I used the script below, but it is incomplete, I do not have the value of 0, only value of 1
my sample has 50000 observations, but only a fraction has rating data as shown below
could you help with the correct coding of LowRate?
Thank you,
Rochelle
I have a string variable splti in data set that denotes the credit rating of a firm's debt. This rating variable can take values such as "AAA" "A" etc, see below.
I want to have a dummy variable LowRate set equal to 1 if the debt rating is below investment grade , which includes ratings such as "BBB-", "CC","CCC","CCC+", "CCC-","D", "SD".
I used the script below, but it is incomplete, I do not have the value of 0, only value of 1
Code:
gen LowRate=1 if inlist(splti,"BBB-", "CC","CCC","CCC+", "CCC-","D", "SD") replace LowRate=. if splti=="" // for firms having missing value for splti
my sample has 50000 observations, but only a fraction has rating data as shown below
Code:
/* A | 296 6.80 6.80 A+ | 131 3.01 9.82 A- | 386 8.87 18.69 AA | 29 0.67 19.36 AA+ | 9 0.21 19.56 AA- | 87 2.00 21.56 AAA | 9 0.21 21.77 B | 266 6.11 27.89 B+ | 291 6.69 34.57 B- | 139 3.20 37.77 BB | 297 6.83 44.60 BB+ | 288 6.62 51.22 BB- | 334 7.68 58.90 BBB | 560 12.87 71.77 BBB+ | 540 12.41 84.18 BBB- | 570 13.10 97.29 CC | 6 0.14 97.43 CCC | 18 0.41 97.84 CCC+ | 69 1.59 99.43 CCC- | 8 0.18 99.61 D | 10 0.23 99.84 SD | 7 0.16 100.00 */
could you help with the correct coding of LowRate?
Thank you,
Rochelle
Comment