BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
KingRoger19
Fluorite | Level 6

Hello everybody,

I have to translate a 4k rows R code into SAS code. The code is not so difficult but uses a couple of packages that I ignore if are present in our current SAS licence. Our SAS licence includes the following main packages:

  • Base SAS Software
  • SAS/STAT
  • SAS/GRAPH
  • SAS Integration Technologies
  • High Performance Suite

while the R code is using these main packages:

MLmetricsMachine Learning Evaluation Metrics
smbinningScoring Modeling and Optimal Binning
ineqMeasuring Inequality, Concentration, and Poverty
InformationData Exploration with Information Theory (Weight-of-Evidence and Information Value)

May I ask you an help to identify any possible lacks between the SAS licence and the R packages currently used?

Thanks all!

Gabriele

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Just a quick comment: R packages are often used because they provide niche computations that are specialized to a subject area (such as "measuring inequality and poverty"). Those specialized computations are (by definition) unlikely to be found in a standard procedure. SAS users often use either the DATA step (for univariate computations) or SAS/IML (for multivariate computations) to implement specialized computations. I suspect you might want to use SAS/IML for some of this project.

 

For what it's worth, if someone hired me to "to translate a 4k rows R code into SAS code," I would ask them to define the input data and the analyses that they want to be performed. I would almost surely not try to "translate" from one language to another one line at a time, but would rewrite the program in the new language to perform the requested analyses.

View solution in original post

7 REPLIES 7
Rick_SAS
SAS Super FREQ

Just a quick comment: R packages are often used because they provide niche computations that are specialized to a subject area (such as "measuring inequality and poverty"). Those specialized computations are (by definition) unlikely to be found in a standard procedure. SAS users often use either the DATA step (for univariate computations) or SAS/IML (for multivariate computations) to implement specialized computations. I suspect you might want to use SAS/IML for some of this project.

 

For what it's worth, if someone hired me to "to translate a 4k rows R code into SAS code," I would ask them to define the input data and the analyses that they want to be performed. I would almost surely not try to "translate" from one language to another one line at a time, but would rewrite the program in the new language to perform the requested analyses.

KingRoger19
Fluorite | Level 6

Hi Rick,

I totally agree with you. We need to translate an IFRS9 model with its risk components (PD, EAD, LGD) and the only problem is that the customer is really hurry with this activity so they will provide us only the input datasets (csv) and the R scripts. We will understand on our own the R code and the desired output (both output csv and graphs) running the scripts. I'm going to ask to customer a documentation in order to understand a bit more which kind of computations they are performing.

Thanks a lot for your kindness, I will update you soon

Gabriele

 

 

KingRoger19
Fluorite | Level 6

Hi Rick,

I gathered a couple of more detailed information from the client. They sent me a list of R functions currently used during the calculation. I mapped them in this way:

R packagesSAS license/procedure
Glm() functionsproc GENMOD
Functionality for creating plots (ggplot2 package)SAS GRAPH
Dplyr functions to rearrange data such as ‘mutate’, ‘filter’,’summarise’,’group_by’ SAS BASE
Gini() from MLmetricsSAS BASE
smbinning.psi(), smbinning() for obtaining optimal bucketing parametersproc HPBIN
step() function on a glm() outcomeSAS BASE
create_infotables() from Information packageSAS BASE

I suggested to take in consideration the possible add of SAS/IML package in order to speed up our porting activities. We will have an alignment with SAS.

Thanks for your kindness, have a nice day.

Gabriele

Ksharp
Super User
Are you making a score card ?
SAS/EM have a individual and need-pay product (credit scorecard) , if you have it you can make it .
Ksharp
Super User

Here is a paper of mine about WOE .

https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/1808-2018.pdf

 

 

And attachment is the code I used for score card.

Ksharp
Super User

If you don't have SAS/EM , all you need is SAS/Base and SAS/Stat , but you need write hundreds of code .

Here is SAS code about making a Credit ScoreCard.

Good Luck.

 

 

KingRoger19
Fluorite | Level 6

First of all thanks a lot for your help and kindness, i really appreciate it! We are working on a IFRS9 model.

As I wrote to Rick, I'm gathering further information to understand if we need the SAS/IML package that you are using too.

 

Take care, cheers!

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 891 views
  • 4 likes
  • 3 in conversation