Hello,

Can you please help me with the following issue: I want to form deciles based on the credit rating for different bonds.
The credit rating variable (rating_num) can take values between 1 and 22.
I tried 2 different methods and they yield the same result:

bys monthly_dates: astile decile_cr_monthly = rating_num, nq(10)

egen decile_r_num = xtile(rating_num ) , by(monthly_dates ) nq(10)

The problem is that in deciles 5 and 7 I have 0 observations.
I understand that this is due to the cutoff point.
I was wondering if there is a way to define the cutoff points such that I have observations in each of the 10 deciles?

Thank you very much for your help!