Download presentation
Presentation is loading. Please wait.
Published byDayna Gardner Modified over 6 years ago
1
Experiences with and Recommendations for using R for Statistics/Analytics Instruction
Abstract: R was the top software in the 2016 KDnuggets Software Poll that asked practicing professionals what software they used for Analytics, Data Mining, Data Science, and Machine Learning projects in the past 12 months. The presenters in this session will report on their experiences with teaching statistics and analytics procedures using R software. This will include the R integration features in JMP and discuss reasons for using R from inside JMP. SEDSI 2017 DASI Session, Thursday, February, 23, 2017, 3 PM
2
Experiences with and Recommendations for using R for Statistics/Analytics Instruction
“Using JMP with R” David Stephan Two Bridges Instructional Technology SEDSI 2017 DASI Session, Thursday, February 23, 2016, 3 PM
3
Why?!! Instructional Reasons Curricular Reasons
Career/Job Placement Considerations Disclaimer: May not be for you or your students
4
Possibly Your Context? My students are general business students
My students seek managerial, not technical careers My school can afford JMP My school is non-residential and/or has many distance learners
5
Is Quality of Help Available a Concern?
Not all HELP is created equal!
6
Do Your Students Need This?
7
Why Not Just JMP? My program has a more “technical” bent, even though we are teaching future mgrs. Not what the “cool kids” use Does JMP do method-of-your-choice? Job placements require “R experience”
8
Why Not Just R? “Let a thousand programmers bloom”1 did not work for Mao Zedong. Do we really want knowledge workers not experiencing commercial software? Have you done basic statistics in R? 1May be a slight misquotation
9
Why JMP and R--what a JMP Staffer Says
“JMP is a wonderful complement to R. The integration with R is surfaced with several new JSL commands that allow you to connect to an install of R on your desktop, send data to and from R, and submit R routines available through the R packages. JMP dialogs can easily be built for parameter input to R as a front-end, and more significantly, JMP’s interactive and dynamic statistical platforms and graphics make for a perfect back-end to R functions. The dialog below is an application that connects to R to create data for a given distribution and perform simulations to test the coverage of bootstrap confidence intervals for a few common statistics.” --Kelci Miclause, JMP
10
Why JMP and R? Best to interactively explore data (e.g., subsetting, aggregation) JMP’s descriptive analytics results for many procedures Can present a better engineered user experience for students
11
Why JMP and R? (not so obvious)
Exposes students to scripting Give students practice with software integration Enables project management assignments It’s not an all (or ) world
12
Software Tools Used JMP Pro 13 and JSL scripting language (also works in JMP 12 or 13) R version with various libraries RStudio (not much help this time)
13
Required Skills JMP user that can perform basic analyses
Some awareness/experience with scripting languages in general Able to search Internet or ask “Buddy” (but not Siri or Alexa!) questions
14
Getting Started Install JMP and R (libraries optional, can be added on the fly) Open JMP Script window File > Open (select script from dialog) or File > New > Script Execute R Init(); (opens R and links JMP to R)
15
JSL R-integration Basics
R Init(); (opens R and links JMP to R) R Send(); (sends data to R) R Get(); (retrieves data from R) R Submit(“ ”); (sends R commands to R) R Term(); (terminates JMP and R link)
16
JSL R-integration: How it works
Command line (log) output appears in JMP log window Graphic outputs appear in separate window (as they would in R)
17
JSL General Commands Used
Open(); opens a data source in JMP New Window(); and Button Box() together allow creation of dialogs with command buttons (minimally implemented in examples)
18
JSL Utility Commands Used
Open(); opens a data source in JMP New Window(); and Button Box() together allow creation of dialogs with command buttons (minimally implemented in examples)
19
Disclaimers for Examples
Emphasizes concepts, not techniques Not necessarily examples of how to best apply JMP or R No specialized or obscure R methods
20
Open in JMP and Use Data in R
R Init(); dtOrig= Open(); New Window( "Select Data", Button Box( "Send Selected Data To R", JMPdt = Current Data Table(); R Send( JMPdt, Selected( 1 ) ); R Submit( "print(JMPdt)" ); ) );
21
Open in JMP and Use Data in R Result
22
Back and Forth From R R Init(); R Submit( "data(attitude)" );
R Get( "attitude" ) << New Data View; New Window( "Attitude Survey", Button Box( "Send Selected Data To R", JMPdt = Current Data Table(); R Send( JMPdt, Selected( 1 ) ); R Submit( "print(JMPdt)" ); R Get(JMPdt)<<NewDataView; ) );
23
Back and Forth From R Result
24
“Better” Back and Forth From R
R Init(); R Submit( "data(attitude)" ); R Get( "attitude" ) << New Data View; New Window( "Attitude Survey", Button Box( "Send Selected Data To R", JMPdt = Current Data Table(); R Send( JMPdt, Selected( 1 ) ); R Submit( " newTable <- rbind(JMPdt, JMPdt[]) " ); R Get(JMPdt)<<NewDataView; ) );
25
Better Back and Forth From R Result
26
Open in JMP and Use Data in R (recalled)
R Init(); dtOrig= Open(); New Window( "Select Data", Button Box( "Send Selected Data To R", JMPdt = Current Data Table(); R Send( JMPdt, Selected( 1 ) ); R Submit( "print(JMPdt)" ); ) );
27
Use R for Hierarchical Cluster Analysis
R Init(); dtOrig = Open(“F:/ThrillRides.jmp”); New Window( “Thrill Rides", Button Box( "Send Selected Data To R", JMPdt = Current Data Table(); R Send( JMPdt, Selected( 1 ) ); R Submit( " dd <- dist(scale(JMPdt[, 3:9]), method = \!"euclidean\!" ) hc <- hclust(dd, method = \!"centroid\!") plot(hc, labels = JMPdt[, 2]) "); ) );
29
R plot(hc) and JMP Dendograms (unfair comparison?)
30
JMP Fully Interactive Dashboard
31
JMP Data Table Subsetting
32
Two Bridges Instructional Technology david@TwoBridgesIT.com
Thank You! David Stephan Two Bridges Instructional Technology SEDSI 2017 DASI Session, Thursday, February 23, 2016, 3 PM
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.