SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
Samz1
Calcite | Level 5

Dear All,

 

As a begginer user to SAS, I was wondering if you could please help me in the following question.

I have a raw data of S&P rating for one year horizon(beginning rating and ending rating) for 15,085 companies. I was wondering how can I calculate the probability of default (PD) from this data and later on do some other procedure such as confidence interval for the probability of defaults in SAS? 

I greatly appreciate any help and comment. 

 

4 REPLIES 4
Reeza
Super User

Your question is vague. Can you expand on your question please? Are you aiming for a predictive model or empirical calculation? 

Samz1
Calcite | Level 5

Hi Reeza thanks for replying back to my post,

my goal is to use non-parametric bootstrap to generate 95% confidence intervals for default rates for each rating category.

First of all, I believe that I have to generate default rates in my raw data, but I am not sure that should I do this step in excel before importing to SAS or am I able to do it in SAS? In my raw data I have the following;

PID: different companies ID, Rating2015_B: rating at the beggining of 2015, Ratinh2015_E: rating at the end of 2015.

I was thinking to create a column Rating2016_D that is for rating at the end of 2015 for those that went to defaults in excel.

Secondly, how can I create a variable called probability of defaults (PD) in SAS?

I know If my data would be smaller I could use (DATA, input, datalines) procedure but since my data has 15,085 observations I don't think that procedure is appropriate. 

I would greatly appreciate any help and advice.

Reeza
Super User

The more lines the better to bring it into SAS. 

 

Start off off with a PROC IMPORT to read in your data. 

 

Then calculate your default variable using a data step. 

ballardw
Super User

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

To provide example data follow instruction here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... to create data step code that you can post or attach as a text file. We can run the posted code to generate data to test code with and avoid multiple questions about things like variable types.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2777 views
  • 0 likes
  • 3 in conversation