Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Calling R Functions from SAS… PhUSE 2011 – 12.10.2011 ….with PROC IML.

Slides:



Advertisements
Similar presentations
PhUSE 2010 Unit Testing and Code Coverage Assessment with SASUnit - Key Technologies for Development of reliable SAS Macros - HMS Analytical Software.
Advertisements

Copyright © 2005, SAS Institute Inc. All rights reserved. Integrating SAS® in a Web Services Architecture Dan Jahn Developer – SAS Cary.
Copyright © 2005, SAS Institute Inc. All rights reserved. User Authentication and Single Sign-on Across the SAS ® 9 Platform Larry Noe and Scott Sweetland,
Introduction to Workflow. Slide 2 Overview What is workflow? What is business process management? Common workflow and process problems The functional.
Java Script Session1 INTRODUCTION.
Copyright © 2005, SAS Institute Inc. All rights reserved. Making the Transition from MDDB-based OLAP Applications to a SAS ® 9 OLAP Solution Ivy Parker.
Copyright © 2010 SAS Institute Inc. All rights reserved. A Quick Introduction to JMP Dara Hammond JMP Account Rep.
This presentation is intended as a detailed WebEx, to bring potential customers to an understanding of Dream Report capabilities. This presentation focuses.
Using R as enterprise-wide data analysis platform Zivan Karaman.
SAS® Data Integration Solution
ManageEngine TM Applications Manager 8 Monitoring Custom Applications.
Integration of Applications MIS3502: Application Integration and Evaluation Paul Weinberg Adapted from material by Arnold Kurtz, David.
Interpret Application Specifications
Lecture 2 LISAM. Statistical software.. LISAM What is LISAM? Social network for Creating personal pages Creating courses  Storing course materials (lectures,
SAS-arithmetics.pdf. Module10: Hypothesis Testing Given a dataset of nitrate concentration of an specific well, we want to know whether the concentration:
How Business Intelligence Software Works and a Brief Overview of Leading Products Jai Windsor MIS 5973 December 8, 2005.
Introduction to SAS Math 3200 Jan Jimin Ding.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Chapter 5 Using SAS ® ETL Studio. Section 5.1 SAS ETL Studio Overview.
Copyright © 2005, SAS Institute Inc. All rights reserved. Need Java Graphics? Use of BIP Graph Components NameRavi Devarajan TitleSoftware Manager DepartmentData.
Create with SharePoint 2010 Jen Dodd Sr. Solutions Consultant
What is Business Intelligence? Business intelligence (BI) –Range of applications, practices, and technologies for the extraction, translation, integration,
Copyright © 2006, SAS Institute Inc. All rights reserved. Enterprise Guide 4.2 : A Primer SHRUG : Spring 2010 Presented by: Josée Ranger-Lacroix SAS Institute.
Overview of SQL Server Alka Arora.
Copyright © 2006, SAS Institute Inc. All rights reserved. What Is New in SAS Profitability Management (PrM) 2.1? Authors: Jack Zhang Solution & Version:
DAT336 SQL Server “Yukon” – The Future of Business Intelligence Jason Carlson Product Unit Manager SQL Server Microsoft Corporation Brian Welcker Microsoft.
SAP Overview SAP? Company ERP Software package –R/2 –R/3.
PO320: Reporting with the EPM Solution Keshav Puttaswamy Program Manager Lead Project Business Unit Microsoft Corporation.
Customer Service and Support Sutherland Global Services Consultant Learning Services Microsoft Store.
Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture.
Using SAS® Information Map Studio
Algoval: Evaluation Server Past, Present and Future Simon Lucas Computer Science Dept Essex University 25 January, 2002.
Transferring VMS SAS/SPSS Data to UNIX Jeff Hayes Social Science Computing Co-op February 26, 1999.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Overview of the SAS® Management Console
Copyright © 2008, SAS Institute Inc. All rights reserved. Interactive Analysis and Data Visualization Using JMP −Dara Hammond, Federal Systems Engineer.
SAS Grid Department of Finance Canada. Agenda SAS in the Department of Finance Before the implementation of SAS Grid Implementation of SAS Grid Effect.
Copyright © 2004, SAS Institute Inc. All rights reserved. SAS Stored Processes An analyst’s perspective Sylvain Tremblay SAS Canada 24 February 2006.
BOĞAZİÇİ UNIVERSITY DEPARTMENT OF MANAGEMENT INFORMATION SYSTEMS MATLAB AS A DATA MINING ENVIRONMENT.
Powered by. Sengen US based firm, founded in 1989 Software product, Application development and Consulting 100+ customers across the globe in diversified.
Copyright © 2012, SAS Institute Inc. All rights reserved. UPDATE FROM SAS WARREN WOERMKE, SAS CANADA.
Presented by Vishy Grandhi.  Architecture (Week 1) ◦ Development Environments ◦ Model driven architecture ◦ Licensing and configuration  AOT (Week 2)
S T A T I S T I C S A U S T R I A March SuperSTAR A joint development with STR D.Burget October 2007 © STATISTICS AUSTRIA I n f.
Ms Dynamics Ax 2012 By Johnkrish. MSD Ax is a Customizable, Multi-language, Multi-Currency ERP Solution. Completely integrated & Web-enabled Supports.
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
1 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to Essbase.
CMPE 226 Database Systems April 19 Class Meeting Department of Computer Engineering San Jose State University Spring 2016 Instructor: Ron Mak
Enterprise Database Systems Introduction to SQL Server Dr. Georgia Garani Dr. Theodoros Mitakos Technological.
SAS Enterprise Business Intelligence (SAS/EBI) Orientation CMS SAS Users Group Conference Learn more about THE POWER TO KNOW ® October 17, Presented.
Copyright © 2006, SAS Institute Inc. All rights reserved. Company confidential - for internal use only SAS/IML Studio Ian Sedgwick.
Managing Database objects in Visual Studio and Team Foundation Server Presented by Sean P SQL Saturday - Phoenix 2016.
Using SAS Stored Processes and the SAS Portal for Delivering Statistics to Drug Discovery Volker Harm PhUSE/PSI One-day Event 2009, Marlow.
Enterprise Resource Planning - PeopleSoft. An ERP system is a business support system that maintains in a single database the data needed for a variety.
E-commerce Architecture Ayşe Başar Bener. Client Server Architecture E-commerce is based on client/ server architecture –Client processes requesting service.
G. Russo, D. Del Prete, S. Pardi Kick Off Meeting - Isola d'Elba, 2011 May 29th–June 01th A proposal for distributed computing monitoring for SuperB G.
HMS A Modern Software Design Principle Applied To SAS Macro Programming: The Inversion Of Control Concept HMS Analytical Software GmbH - Dr. P. Warnat.
Slide 1 © 2016, Lera Technologies. All Rights Reserved. Oracle Data Integrator By Lera Technologies.
AuraPortal Cloud Helps Empower Organizations to Organize and Control Their Business Processes via Applications on the Microsoft Azure Cloud Platform MICROSOFT.
SAP Overview.
Netscape Application Server
MatLab Programming By Kishan Kathiriya.
Profitability Management Logical Diagram
R Programming.
Week 1 Gates Introduction to Information Technology cosc 010 Week 1 Gates
EasyMap Xplorer: See Your Business Data in a Map!
Oracle Architecture Overview
Introduction to Essbase
DAT381 Team Development with SQL Server 2005
Developing and testing enterprise Java applications
Presentation transcript:

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Calling R Functions from SAS… PhUSE 2011 – ….with PROC IML

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH 2 Company HMS Analytical Software is a specialist for Information Technology in the field of Data Analysis and Business Intelligence Systems Profile – 40 employees in Heidelberg, Germany – SAS Institute Partner for 15 years – Doing data oriented software projects for more than 20 years – Focus on life science industry Technologies – Analytics and Data Management: SAS, JMP, R, Microsoft SQL Server – Application Development: Microsoft.NET, Java

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Our IT Services for the Life Science Industry (SAS, JMP, R and Microsoft) Independent Consulting Programming Data Management Data Mining / Analysis Training and Individual Coaching Application Development and Integration Software Validation 3

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Agenda Servey Who needs an interface to R Requirements How to submit R Code? What about data sets and SAS formats? Do I get my R Graphics into SAS-Report How to handle errors coming from R Questions that came up during PhUSE 4

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Degree of Popularity of R compared to PhUSE 2010 yes no 5

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH The Best of two Worlds 6

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH The Best of two Worlds 7 Client Tier Management Console Data Integration Studio Information Map Studio Enterprise Guide …. Web Tier Web Report Studio Information Delivery Portal STP Web Application …. Server Tier Connect Server SAS Foundation OLAP Server STP Server …. Data Tier Data Sets OLAP Cubes ERP data structure RDBMS Tables …. Metadata Server BioConductor Bioinformatic community Rgeo Spatial Statistics gR Graphical Models Robus Robus statistics Rmetrics Financial Market Analysis Omega Distributed Statistical Computing

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Who needs an Interface to R? People who don´t want a “religious” decision between SAS or R. They want both! People who want to use one of the huge amount of add-on-packages of R Lazy people, who don´t want to convert their existing R code to SAS People who switch from R to SAS People who want to validate their SAS programs (Nikhil Abhyankar, yesterday talk) 8

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH SAS/IML as an Interface to R SAS Interactive Matrix Language (IML) is a programming language for explorative data analysis. wide range of most standard matrix operations direct access to SAS data sets create dynamic graphics 9 it has the an interface to R PROC IML use this interface

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Requirements to Use PROC IML as an Interface to R 10 SAS 9.22SAS bit and 64-bit Windowsxx 32-bit and 64-bit Linux-x 32-bit version of Rxx 64-bit version of R-x Supported R VersionsR or before ?? R must be installed on the same computer / server access to the SAS workspace server via Enterprise Guide®

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH How to submit R Code 1. Start SAS with the RLANG-option (C:\...\sas.exe -RLANG). 2. Check access to R NORLANG:Do not support access to R language interfaces ERROR: The RLANG system option must be specified in the SAS configuration file or on the SAS invocation command line to enable the submission of R language statements. WARNING: SAS option RLANG is not supported on this host. RLANG:Support access to R language interfaces 11

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH How to submit R Code 3. Use PROC IML as the interface to R 12

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Sending Data from SAS to R and back - IML built-in subroutines- From SAS to R: 13 SubroutineSAS SourceR Destination ExportDataSetToRSAS data setR data frame ExportMatrixToRSAS/IML matrixR matrix SubroutineR SourceSAS Destination ImportDataSetFromRR expressionSAS data set ImportMatrixFromRR expressionSAS/IML matrix From R to SAS:

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Sending SAS Data Sets to R 14

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Getting SAS Data Sets back from R 15

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH What about Date, Times and Datetime Values? From SAS to R: 16 SASR Date (e.g. DATEw.d)Class „Date“ Datetime (e.g. DATETIMEw.d)Classes that inherit from Class „POSIXT“ Time (e.g. TIMEw.d)Classes inherit from Class „POSIXT“ All other formatsClass „numeric“

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH What about Date, Times and Datetime Values? From R to SAS: 17 RSAS Class „Date“DATE9. Class „POSIXT“TIME19. In all other casesno SAS format is assigned

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Get Graphics from R to SAS 18

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Get Graphics from R to SAS 19

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Handling Errors from R Error: Division by a alphanumeric variable: 1.have a look to the SAS LOG 20

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Handling Errors from R 2. read out the global SAS macro variable SYSERRORTEXT (holds the last error message) 21

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Handling Errors from R 3. Use tryCatch-block in R and write the error message to a SAS data set 22

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Handling Errors from R 3. Use tryCatch-block in R and write the error message to a SAS data set 23

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Limitations No option to tell SAS which R to use. Large data sets are limited by memory size – In R the data are load and processed in the main memory. The same is true for SAS IML. R comes along with absolutely no warranty – take this especially into account for the large amount of add-on-packages. Not all data types from R can be converted – every data type has to be converted either to a data.frame or a matrix before transferring data to SAS 24

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Questions during PhUSE… What is faster SAS or R? 25

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Questions during PhUSE… Is PROC IML the only way to run R programs? 26

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Questions during PhUSE… Is R easy to learn? 27

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Questions during PhUSE… Is R easy to learn? 28 2-day-training course, HMS

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Questions during PhUSE… Is are a validated environment? no, it is NOT: R comes along with absolutely no warranty 29

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH Conclusion The best of two worlds. SAS implements a powerful interface to R within PROC IML. SAS data sets can be send to R and back. Some SAS formats are converted to R counterpart. R graphics can be integrated into SAS PDF-reports. Different ways to handle errors from R in SAS. 30

Dr. Peter Bewerunge © 2009 HMS Analytical Software GmbH 31 Thank you for your Attention Dr. Peter Bewerunge Software Engineer HMS Analytical Software GmbH Rohrbacher Str Heidelberg Telefon Dr. Peter Bewerunge Software Engineer HMS Analytical Software GmbH Rohrbacher Str Heidelberg Telefon