SAS-R Integration Example: Transform Data in R, Analyze it in SAS!
Channel: Monika Wahi
Date: 2021-12-26

*Note: I may be compensated, but you will not be charged, if you click on the links below.

If you are a data scientist – especially in the healthcare field - you might wonder why you would want to learn BOTH SAS and R. Here, I provide a PERFECT example of when to use SAS-R integration, which I also document on my blog:
https://buff.ly/3z5da4T
I post my code on Github: https://buff.ly/3rBzh0y 
…but you want to read the blog post or watch the video to see which code goes in what program!

Want to get started with SAS ODA? Take Monika’s free course: https://buff.ly/3CQVPxG 
Want to learn SAS Data Warehousing? Read Monika’s book, “Mastering SAS Programming for Data Warehousing”: https://buff.ly/31Hz1mg 

Want to be a data scientist in healthcare? Watch Monika’s lecture series on the US healthcare: https://buff.ly/3zGNASn 
Try Monika’s courses on LinkedIn Learning: https://linkedin-learning.pxf.io/NKN0JO 
Follow/connect with Monika on LinkedIn: https://www.linkedin.com/in/dethwench/ 
Follow Monika on Twitter: https://twitter.com/PHExaminer 
Sign up for Monika’s data science weekly e-mailed newsletter: https://dethwench.com/get-data-science-newsletter/ 
Here’s another video about a SAS-R integration success story from the Mayo Clinic: https://www.rstudio.com/resources/rstudioconf-2018/a-sas-to-r-success-story/ 
Are you doing any SAS-R integration – or any other type of SAS or R integration with some other software? Leave a comment and tell us about it!

Timestamps/Links so you can navigate video:
01:05 Advantages and disadvantages of R
01:47 Explanation of the data used in the project
02:22 Sample vs. population analysis – using the population weights
03:17 Advantages and disadvantages of SAS
03:41 Book “Mastering SAS Programming for Data Warehousing”: https://buff.ly/31Hz1mg
04:44 Solution: I used SAS OnDemand for Academics (ODA) to run PROC SURVEYREG after uploading an exported *.csv of the analytic dataset built in R GUI
05:07 View of solution SAS ODA environment
05:19 In SAS ODA, you need to use PROC IMPORT or the import utility to convert a *.csv to a SAS dataset so it can be used in the environment
05:37 Example of PROC SURVEYREG output in SAS ODA
05:55 Similar setup can be achieved hitting a SQL view from SAS through the SAS/Access component which uses an ODBC connection: https://www.lexjansen.com/nesug/nesug10/cc/cc20.pdf

SAS-R Integration Example: Transform Data in R, Analyze it in SAS!