creating more analytical bandwidth with r...creating more analytical bandwidth with r matthew j....

Post on 24-Jan-2021

5 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Creating more Analytical Bandwidth with R

Matthew J. Flynn, PhD Predictive Analytics World, New York City, October 20, 2011

mjflynn@travelers.com 860-954-0894

R2SAS - Background Travelers is a multi-line top 10 P&C Insurance Carrier – experiencing recent rapid growth in Analytics

Travelers Analytics – 5+ Research Depts., SAS User Group 550+ members, approx. 120 JMP seats (from 0 in two years), and 50-80 current R users

My Role – Modeling, Consulting, & Tool-building

Motivation – All data is on UNIX (AIX & Linux) SAS Servers & variety of databases

Need – Two Groups – 1) Some Experienced modelers are experimenting with R stats, 2) New grads with only R background need quickly to get up to speed with SAS to be productive – currently data access in all manual.

How – R package for (D)COM enables access to JMP Automation and SAS/IT

3

JMP 9 – R Connection (Main Menu(“Help: Scripting Index: R Connection”) )

4

Introducing r2SAS – R – JMP Connection

5

R – JMP Connection - usage - Load the r2SAS library (collection of functions)

6

r2SAS – functions to connect to JMP and SAS

7

Connect to JMP - open an existing JMP data table

8

JMP VB Automation docs – OpenDocument(“filename”)

9

Connect to JMP – run some JSL

10

Create and execute a JSL script from disk

11

Create a new JMP data table & populate it with data

12

Return JMP Formula Column back to R from the JMP Table

13

Via JMP, we can push R data to a JMP table & on through to SAS

14

Send R data to JMP, submit JSL, Fit Model calculating new column, bring back to R

15

Send R data to JMP, submit JSL, Fit Model calculating new column, bring back to R

16

Launch a platform

17

Pause for Questions?

r2SAS – on to connecting with SAS

18

Connect to local PC SAS & directly submit SAS code

19

Connect to local PC SAS & Submit existing SAS program

20

Returned is the SAS log and listing – SAS Datasets can then be Imported into R vectors & data frames

21

Return the result data to R as a data frame & graph

22

example call – connect to UNIX SAS

23

Run an existing program on the server, (passing parameters)

24

Submit SAS code to the SAS server

25

And return SAS data to R on desktop

26

r2SAS v0.1 – to do’s – a lot

Add error checking (current very little) Perhaps a GUI in R to submit code for demo Submit local SAS program file on remote sever Return SAS output as HTML/PDF/etc – (requires Creating a SAS result package) Async submit Return a graph from JMP to R Return R data directly to SAS Better model examples Your suggestion here…

27

r2SAS

Contact info: Matt Flynn – Travelers mjflynn@travelers.com 860.954.0894

Thank you – Questions?

28

Appendix – resources

29

Appendix – resources

# NESUG 2010 Multiple Methods in JMP® to Interact with R # http://www.nesug.org/Proceedings/nesug10/po/po06.pdf # NESUG 2009 Automating JMP via Scripting tools and MS Windows COM # http://www.nesug.org/Proceedings/nesug09/ap/ap09.pdf # Usage Note 11089: How to enable JMP as a single use server for automation # http://www.jmp.com/support/notes/11/089.html # See also: # # GetObject and CreateObject behavior of Office automation servers # http://support.microsoft.com/kb/288902 # How to obtain the window handle for an Office Automation server # http://support.microsoft.com/kb/258511 # http://communities.sas.com/message/47978#47978

top related