From the course: SAS Programming for R Users, Part 1

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Demo: Calling R from SAS

Demo: Calling R from SAS

- [Narrator] And in the final demonstration, I want to show you how to easily work with R from SAS/IML. So we're not telling you not to use R, and in fact, if there's a nice library that you like to use, or there's some code that you want to use, it's actually extremely easy to use it inside IML. So we can export our data to R, we can write R code directly in IML, it'll send it over to R, it'll do all the analyses, and then you can bring back the results and compare your results if you'd like. So to do this seamlessly, there's some really intuitive sub-routines that we'll use, like export data set to R, which does exactly what you'd expect, and then everything between the submit and endsubmit statement is R code, so that's going to be written exactly as if you're in R Studio. And in this case, I'm using the random forest library, and the random forest function, and I'm actually analyzing the birth weight data set from before, when we did the Bayesian Logistic Regression analysis. This…

Contents