Ask the Expert

SAS expertise delivered to your desktop -- on-demand and free!
BookmarkSubscribeRSS Feed

Leveraging R for Statistical Analysis in LSAF Q&A, Slides, and On-Demand Recording

Started ‎01-13-2025 by
Modified ‎01-13-2025 by
Views 872

Watch this Ask the Expert session to learn how using R in the Life Sciences Analytics Framework (LSAF) enhances the analytical capabilities of life science researchers.

 

Watch the Webinar

 

You will learn how to:

  • Add, explore, visualize and compute R and .Rdata files in LSAF.
  • Use compliance and performance traceability with R.
  • Effectively assess R package for accuracy within a validated LSAF infrastructure.

The questions from the Q&A segment held at the end of the webinar are listed below and the slides from the webinar are attached.

 

Q&A

Can you provide a data mgmt example for LSAF use? Is that the DSMB?

My data management group did our SDTM transformation, so they may be inside of LSAF doing the programming to take my raw data to SDTM. They could also be inside of LSAF taking raw data or data that's coming from an EDC system and creating edit checks to that SAS code. We used to have people do that, but they couldn't do it within their EDC system. There may have been some edit check programs that they wrote in SAS to do additional edit checks, and they would write those. They could write those inside of LSAF and have an edit check piece of information or piece of program with an LSAF to run.

 

Can I use this LSAF for my model: spatially conditional nested logit model? I am finding it difficult to do this analysis only in SAS environment.

Yes, you can use LSAF for stat programming tables listings. I can use LSAF as a biostatistician to do models and simulations. LSAF within the LSAF system includes your Base SAS, your SAS stat. All those stat procedures that statisticians used back in the day. I used proc ttest. Basically, is my drug better than nothing? Is my drug better than a comparator? But all the stat procedures are available in there as well as your SAS graph and IML. So, all the procedures in base stat graph IML are available inside of LSAF.

 

Will rstan and knitr be added to the package list soon?

I'm not totally familiar with ours, sounds like those are a couple of packages they could be. One of the things that we do internally at SAS as we have LSAF customers using the product, they may have additional R packages that most of the industry are using. When we put R packages inside of LSAF, we run them through our qualification. Do they work? Do they function like they're supposed to function? You as a customer still need to make sure that those packages are working for how you want to use them. SAS cannot test every possible way that a user may use these packages. We do our qualification, but it may not be sufficient for you as a customer. We do count on you, and you have that availability to test these yourself and make sure they dot all your I’s cross all your T's for your regulatory group. And Matt, just to add on to that, the knitr is already added to the package. The other one can be. We can add based on what you requested.

 

Can I use LSAF for mapping data in a large data base?

Absolutely you could. Within LSAF, we do provide access engines as well. As many of you may know, SAS has a lot of access engines like S3. These access engines allow me to have a way to reach out to an external database like Snowflake and be able to push a query using Proc SQL. Let's say I have got a Snowflake database that has a data set in it that could be a million records. And I only want to pull out patients that had a specific ICD 10 code. We push that query into the database using an Access engine and we only pull back what you want. Then you can program, create, do additional data manipulation on that, and then you can push that back. If I'm doing a transformation of an external database, I would want to see how much I could do in that database versus having to pull that data over into a SAS data set because that is going to cause latency. But with our Access engines, there's a lot of ETL (extract transform load) you can send to the database with PROC SQL.

 

Is it possible to install a package from CRAN to LSAF directly?

Not directly. It must go through our package management. Locally, I would pull down the package from CRAN that I want. Then I am pushing that into my workspace, testing it there, and then that gets loaded into the actual LSAF environment. I cannot do that directly in LSAF. I tried it and it gives me this message that you cannot do a CRAN mirror inside of LSAF because LSAF is a very qualified environment. We do not want to have all these open connections to the outside world because that defeats that qualification.

 

Thank you. so how can I get a LSAF? I am sorry, I am new to this.

If you want to reach out to me, matt.backer@sas.com I can put you in touch with someone within our team. But to just start, just send either me or Pritesh a message and we can get that started for you.

 

When you say you use ChatGPT to create R code, are you outside of LSAF or you can pull ChatGPT in LSAF?

In my example, I was outside of LSAF. I will tell you that SAS is looking at building a Copilot within our products that you would be able to do it within, but that is not available today.

 

Can we use this in 3.4 version software?

I am assuming they mean R 3.4. One of the things with LSAF is we qualify our versions as we do new releases of LSAF. We are qualifying and putting in new releases of R. So, do we have 3.4 supported within LSAF? I do not believe so. Now could I have a 3.4 R environment outside of LSAF that I am using web services to send our code and data to it, it runs it, and I get the results back? Yes, but within LSAF we cannot have an R 3.4 version running.

 

Can I create PowerPoint presentations? Or html documents?

You can create HTML documents, but not PowerPoint presentations.

 

Do I understand correctly the R packages you "added" to LSAF are validated by SAS?

The packages that are in LSAF are qualified by SAS. So, we make sure that they run and they are giving the results we expect. We cannot validate. We cannot say that these will work for every one of our customers because you as a customer may use these packages a little differently. You may expect different things. So, we always impress upon our customers these are qualified by SAS. You need to make sure to do your own UAT to make sure they are good for you.

 

Can we use GCP Big query?

We do have an access engine to Big Query. So, you could get that access engine and be able to reach out to it. One caveat, If I have got a Google Cloud Big Query database and I want to be able to reach out to it via SAS Access engine, you must make sure those ports are open and the ports on the Google side are open. So, there is that IT stuff that must happen. Again, as a qualified environment, we do not open every port. We work with your IT and business users to make sure that you are set up to database connections needed in your system specs.

 

Can we create an RTF file?

Absolutely.

 

What have you found as best reasons to create an R program instead of a SAS program?

With R, I do a lot with graphs. I use SAS graph, but there are certain things that I can do in R a lot quicker than I can in SAS. We also have a mix now of personnel. When we talk to our customers, they have SAS programmers, and they may have R programmers. Some people are more proficient in R than they are in SAS. So, they may be using R to do certain tasks or certain output versus SAS. Those are a couple of examples.

 

Would you elaborate about your recommendation for using Webdav to map local drives? SAS had set up SAS Drug Development Desktop Connection for us and later instructed us that SDDDC was no longer supported.

The reason SAS Drug Development Desktop Connection (SDDDC) was useful is because what you could do is check in and check out all the files locally and then do your third-party word file, Python file, or R file. You can edit that stuff and then again check in and check out stuff with the web dev. What you get is access to something for repository you cannot touch. But I think those will be done on the workspace of the house. I would not touch the repository part with the web dev, but the workspace part I can.

You can still use some of the functionality of SDDDC by mapping your network drive to repo/work. When mapping a network drive, it uses the same network address that you use in SDDDC. Sometimes it is useful to look at these files or with 3rd party tools directly execute data from your machine.

 

Are you going to add Python functionality?

This is like my example with the R 3.4. If I wanted to have a Python server set up outside and send data and Python code out to that Python environment to run and then pull it back, that is available. Whether SAS will add Python to LSAF, I can not tell you we will. It might be the next version of LSAF, but currently we do not have a Python editor session. But right now, there are certain packages available in R where you can pass those to Python based processes. So, there are certain things available directly inside R studio that you can do that.

 

Can R scripts be automated effectively in LSAF for recurring analyses, and how does this compare with SAS macros?

R scripts can be automated. The job I showed you created the DSMB one, everything I want to have create something in my repository must be run as a job. So, if I have written an R script or R program and I want to be able to run that every week, every month, or when new data appears, I can set that up as a job that is kicked off with some workflow. Within LSAF, we have workflows, which are just business process items that I can put together. In this example, I have a string of items, and we even have listeners. If a new data set changes in a folder, it will automatically kick off a job. So, it could kick off that R job that inputting that data that has changed and creating new output from it. You can automate R scripts within LSAF. How are they different than macros? SAS macros? I do not know. An R function is like a SAS macro, I would think.

 

What are the regulatory requirements prospective in using both R and SAS for regulatory submissions to FDA, EMA, MHRA etc.?

FDA has never denoted that you must use SAS for your submissions. It's the de facto standard. I do know that there are life science customers that have submitted submissions using R. I do not think that the FDA is against a combination of R and SAS. I think for every submission or every discussion that you are having with that reviewer, you really need to make it clear to them what are the options that are available to me. Every reviewer may be a little different. Your reviewer may know SAS and they may not know R, or your reviewer may have a team that knows R and SAS. So, it may be fine, but I would 100% check with your FDA reviewer of whether R and SAS are OK. The FDA does not mandate that you must use SAS, I can tell you that.

 

SAS is qualified and validated within LSAF. Is R validated and qualified as well in the same way?

R and its packages are qualified.

 

Is not the ability to use an R Shiny dashboard "without having to sign into SCE" a major security risk?

For R-shiny app, users must sign in with their user ID and password.

 

What is the version of R? Can that documentation be provided of this qualification & validation?

Version 4.1, Matt just showed right now. Yes, all documentation is provided.

 

Is it possible to have more than one version or R (R sessions), qualified?

Not within LSAF.

 

Is the list of packages publicly available (perhaps in LSAF documentation)?

During engagement, the SAS consulting team usually will work with the customer to provide what is available and what can be provided during installation. You can find the list of R packages included here: https://support.sas.com/kb/69/698.html

 

Are there any SAS developed libraries/macros for data exchange between SAS and R?

Good question. SAS dataset can be read in R (haven package) and R-data frame can be read in SAS (proc IML).  That is how I do it.

 

Are the mapped LSAF directory write-protected?

Yes.

 

What was the process to select and validate R packages included in LSAF? Do you still need packages for R packagement within LSAF?

https://support.sas.com/kb/69/698.html This link will provide the packages that are qualified within R. Anything new, we will provide the documentation for R-pkg mgmt to add new.

 

What are the differences between R studio and R in LSAF?

Pros: Execution of R in LSAF is done in a qualified way, check-in\check-out, audit trail etc. Con: R-studio is more flexible, compared to LSAF-R GUI.

 

What term is mapping your drive? It that WebDAV? Is that short for something?

Webdav is short for Web Distributed Authoring and Versioning. It enhances HTTP to allow users to manage and edit files on a web server collaboratively.

 

What resources or training would you recommend for programmers transitioning from SAS to R within the LSAF ecosystem?

There are a number of online free R user communities, training, etc available. In addition, conferences have alot of information and user presentations. PharmaSUG is one example. Posit may have some good R tutorials.

 

I'm new to LSAF, can you recommend a website/video for basics?

We have a .

 

Can we use LSAF for data listing program in?

Yes.

 

What is the option to get access for LSAF?

Please reach out to your SAS liaison within your organization, or email Matt (matt.becker@sas.com) or Pritesh (pritesh.desai@sas.com) with your organization name.

 

A struggle with creating reports but I do not know database structure. I have only the request for final reports.

When you say you do not know the database structure, do you have the data? One option is to run a proc contents on your library of data to get the structure of each dataset. Then you will need to take the final report request and identify what dataset/variable combination supports the output being requested.

 

I am searching a tool for automate the business process using pk, fk, constrains .. ,

I believe this question is a tool to automate a process when you receive PK data to, as an example, a) read it b) do some transformations/data management and c) create a report. LSAF allows you to write the programming to do a, b, and c ONCE and then use workflows to run it as needed (daily, weekly, monthly, when new PK data arrives, etc).

 

Can we use Python?

If I wanted to have a Python server set up outside and send data and Python code out to that Python environment to run and then pull it back, that is available. Whether SAS will add Python to LSAF, I cannot tell you we will. It might be the next version of LSAF, but currently we do not have a Python editor session. But right now, there are certain packages available in R where you can pass those to Python based processes. So, there are certain things available directly inside R studio that you can do that.

 

Can we have demo on getting it AWS using s3?

Please email Matt (matt.becker@sas.com) or Pritesh (pritesh.desai@sas.com) with your organization name and request (demo of LSAF and AWS S3).

 

 

Recommended Resources

Extending the umbrella of compliance: LSAF with R Distributed Computing

R and SAS working together

SAS® Life Science Analytics Framework 5.4.x - List of available R software packages and the installe...

Please see additional resources in the attached slide deck.

 

Want more tips? Be sure to subscribe to the Ask the Expert board to receive follow up Q&A, slides and recordings from other SAS Ask the Expert webinars.

Version history
Last update:
‎01-13-2025 04:28 PM
Updated by:

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

SAS Training: Just a Click Away

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

Browse our catalog!

Article Tags