SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
 What is R?
                                                                                         R’s Advantages
                                                                                         R’s Disadvantages
                                                                                         Installing and Maintaining R
                                                                                         Ways of Running R
Bob Muenchen, Author R for SAS and SPSS Users,
                                                                                         An Example Program
         Co-Author R for Stata Users
                                                                                         Where to Learn More
 muenchen.bob@gmail.com, http://r4stats.com




            Copyright © 2010, 2011, Robert A Muenchen. All rights reserved.                                                             2




                                                                                   “The most powerful statistical computing language
                                                                                      on the planet.” -Norman Nie, Developer of SPSS
                                                                                     Language + package + environment for
                                                                                      graphics and data analysis
                                                                                     Free and open source
                                                                                     Created by Ross Ihaka & Robert Gentleman 1996
                                                                                      & extended by many more
                                                                                     An implementation of the S language by
                                                                                      John Chambers and others
                                                                                     R has 4,950 add-ons, or nearly 100,000 procs


                                                                              3                                                         4
5                Source: r4stats.com/popularity
                                                                                                      6
                    http://r4stats.com/popularity




1.   Data input & management (data step)                * SAS Approach;
2.   Analytics & graphics procedures (proc step)        DATA A; SET A;
3.   Macro language                                       logX = log(X);
4.   Matrix language                                    PROC REG;
5.   Output management systems (ODS/OMS)                  MODEL Y = logX;

R integrates these all seamlessly.                      # R Approach
                                                        lm( Y ~ log(X) )

                                                    7                                                 8
 Vast selection of analytics & graphics
 New methods are available sooner
 Many packages can run R (SAS, SPSS, Excel…)
 Its object orientation “does the right thing”
 Its language is powerful & fully integrated
 Procedures you write are on an equal footing
 It is the universal language of data analysis
 It runs on any computer
 Being open source, you can study and modify it
 It is free

                                                          9                                                             10




* Using SAS;                                                    Language is somewhat harder to learn
PROC TTEST DATA=classroom;                                      Help files are sparse & complex
CLASS gender;                                                   Must find R and its add-ons yourself
VAR score;
                                                                Graphical user interfaces not as polished
                                                                Most R functions hold data in main memory
# In R
                                                                  Rule-of-thumb: 10 million values per gigabyte
t.test(score ~ gender, data=classroom)
                                                                  SAS/SPSS: billions of records
                                                                  Several efforts underway to break R’s memory limit
t.test(posttest, pretest , paired=TRUE, data=classroom)            including Revolution Analytics’ distribution


                                                          11                                                            12
 Base R plus Recommended Packages like:                        Email support is free, quick, 24-hours:
      Base SAS, SAS/STAT, SAS/GRAPH, SAS/IML Studio              www.r-project.org/mail.html
      SPSS Stat. Base, SPSS Stat. Advanced, Regression           Stackoverflow.com
 Tested via extensive validation programs                        Quora.com
 But add-on packages written by…                                 Crossvalidated stats.stackexchange.com
      Professor who invented the method?                          /questions/tagged/r
      A student interpreting the method?                       Phone support available commercially




                                                          13                                                14




1. Go to cran.r-project.org,                                    Comprehensive R Archive Network
   the Comprehensive R Archive Network
                                                                Crantastic.com
2. Download binaries for Base & run                             Inside-R.org
3. Add-ons:                                                     R4Stats.com
   install.packages(“myPackage”)
4. To update: update.packages()




                                                  15                                                        16
17   18




19   20
 Run code interactively
      Submit code from Excel, SAS, SPSS,…
      Point-n-click using
       Graphical User Interfaces (GUIs)
      Batch mode




21
                                             22




23
                                             24
Copyright © 2010, 2011, Robert A Muenchen. All rights reserved.        26
                               25




run ExportDataSetToR("mydata");     GET FILE=‘mydata.sav’.
                                    BEGIN PROGRAM R.
submit/r;
                                    mydata <- spssdata.GetDataFromSPSS(
   mydata$workshop <-
                                      variables = c("workshop gender
     factor(mydata$workshop)
                                      q1 to q4"),
   summary(mydata)                    missingValueToNA = TRUE,
endsubmit;                            row.label = "id" )
                                    summary(mydata)
                                    END PROGRAM.

                               27                                                                               28
29   30




          32
31
34
                                              33




 A company focused on R development & support
 Run by SPSS founder Norman Nie
 Their enhanced distribution of R:
  Revolution R Enterprise
 Free for colleges and universities, including for
  outside consulting




                                                      35
43   44
mydata <- read.csv("mydata.csv")                                      > mydata <- read.csv("mydata.csv")
 print(mydata)                                                         > print(mydata)
                                                                          workshop gender q1 q2 q3 q4
 mydata$workshop <- factor(mydata$workshop)
                                                                       1        1      f 1 1 5 1
 summary(mydata)
                                                                       2        2      f 2 1 4 1
 plot( mydata$q1, mydata$q4 )                                          3        1      f 2 2 4 3
                                                                       4        2   <NA> 3 1 NA 3
 myModel <- lm( q4~q1+q2+q3, data=mydata )                             5        1      m 4 5 2 4
 summary( myModel )                                                    6        2      m 5 4 5 5
 anova( myModel )                                                      7        1      m 5 3 4 4
 plot( myModel )
                                                                       8        2      m 4 5 5 5
                                                                  45                                        46




> mydata$workshop <-factor(mydata$workshop)
> summary(mydata)
 workshop       gender
 1:4        f      :3
 2:4        m      :4
            NA's:1
q1                  q2             q3              q4
Min.   :1.00        Min.   :1.00   Min.   :2.000   Min.   :1.00
1st Qu.:2.00        1st Qu.:1.00   1st Qu.:4.000   1st Qu.:2.50
Median :3.50        Median :2.50   Median :4.000   Median :3.50
Mean   :3.25        Mean   :2.75   Mean   :4.143   Mean   :3.25
3rd Qu.:4.25        3rd Qu.:4.25   3rd Qu.:5.000   3rd Qu.:4.25
Max.   :5.00        Max.   :5.00   Max.   :5.000   Max.   :5.00
                                   NA's   :1.000
                                                                  47                                        48
> myModel <- lm(q4 ~ q1+q2+q3, data=mydata)
> summary(myModel)

Call:
lm(formula = q4 ~ q1 + q2 + q3, data = mydata)
Residuals:
      1       2       3       5       6        7      8
-0.3113 -0.4261 0.9428 -0.1797 0.0765 0.0225 -0.1246
Coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.3243      1.2877 -1.028     0.379
q1            0.4297     0.2623   1.638    0.200
q2            0.6310     0.2503   2.521    0.086
q3            0.3150     0.2557   1.232    0.306
Multiple R-squared: 0.9299,     Adjusted R-squared: 0.8598
F-statistic: 13.27 on 3 and 3 DF, p-value: 0.03084


                                                             49   Copyright © 2010, 2011, Robert A Muenchen. All rights reserved.   50




                                                             51                                                                     52
 R for SAS and SPSS Users, Muenchen
                                                          R for Stata Users, Muenchen & Hilbe
                                                          R Through Excel: A Spreadsheet Interface for Statistics,
                                                           Data Analysis, and Graphics, Heiberger & Neuwirth
                                                          Data Mining with Rattle and R: The Art of Excavating
                                                           Data for Knowledge Discovery, Williams




                                                    53                                                                54




 R is powerful, extensible, free
 Download it from CRAN
 Academics download Revolution R Enterprise
  for free at www.revolutionanalytics.com
 You run it many ways & from many packages
                                                                              muenchen@utk.edu
 Several graphical user interfaces are available
 R's programming language is the way                                   Slides: r4stats.com/misc/webinar
                                                                         Presentation: bit.ly/R-sas-spss
  to access its full power


                                                    55

Mais conteúdo relacionado

Mais procurados

Accelerating R analytics with Spark and Microsoft R Server for Hadoop
Accelerating R analytics with Spark and  Microsoft R Server  for HadoopAccelerating R analytics with Spark and  Microsoft R Server  for Hadoop
Accelerating R analytics with Spark and Microsoft R Server for Hadoop
Willy Marroquin (WillyDevNET)
 
The network structure of cran 2015 07-02 final
The network structure of cran 2015 07-02 finalThe network structure of cran 2015 07-02 final
The network structure of cran 2015 07-02 final
Revolution Analytics
 

Mais procurados (20)

DeployR: Revolution R Enterprise with Business Intelligence Applications
DeployR: Revolution R Enterprise with Business Intelligence ApplicationsDeployR: Revolution R Enterprise with Business Intelligence Applications
DeployR: Revolution R Enterprise with Business Intelligence Applications
 
Accelerating R analytics with Spark and Microsoft R Server for Hadoop
Accelerating R analytics with Spark and  Microsoft R Server  for HadoopAccelerating R analytics with Spark and  Microsoft R Server  for Hadoop
Accelerating R analytics with Spark and Microsoft R Server for Hadoop
 
Introduction to Microsoft R Services
Introduction to Microsoft R ServicesIntroduction to Microsoft R Services
Introduction to Microsoft R Services
 
Basics of Digital Design and Verilog
Basics of Digital Design and VerilogBasics of Digital Design and Verilog
Basics of Digital Design and Verilog
 
Revolution R Enterprise - Portland R User Group, November 2013
Revolution R Enterprise - Portland R User Group, November 2013Revolution R Enterprise - Portland R User Group, November 2013
Revolution R Enterprise - Portland R User Group, November 2013
 
Performance and Scale Options for R with Hadoop: A comparison of potential ar...
Performance and Scale Options for R with Hadoop: A comparison of potential ar...Performance and Scale Options for R with Hadoop: A comparison of potential ar...
Performance and Scale Options for R with Hadoop: A comparison of potential ar...
 
Big data business case
Big data   business caseBig data   business case
Big data business case
 
The network structure of cran 2015 07-02 final
The network structure of cran 2015 07-02 finalThe network structure of cran 2015 07-02 final
The network structure of cran 2015 07-02 final
 
Big data analytics using R
Big data analytics using RBig data analytics using R
Big data analytics using R
 
Microsoft R Server for Data Sciencea
Microsoft R Server for Data ScienceaMicrosoft R Server for Data Sciencea
Microsoft R Server for Data Sciencea
 
R at Microsoft (useR! 2016)
R at Microsoft (useR! 2016)R at Microsoft (useR! 2016)
R at Microsoft (useR! 2016)
 
R for data analytics
R for data analyticsR for data analytics
R for data analytics
 
The R Ecosystem
The R EcosystemThe R Ecosystem
The R Ecosystem
 
Data Science At Zillow
Data Science At ZillowData Science At Zillow
Data Science At Zillow
 
Predicting Loan Delinquency at One Million Transactions per Second
Predicting Loan Delinquency at One Million Transactions per SecondPredicting Loan Delinquency at One Million Transactions per Second
Predicting Loan Delinquency at One Million Transactions per Second
 
R and-hadoop
R and-hadoopR and-hadoop
R and-hadoop
 
R at Microsoft
R at MicrosoftR at Microsoft
R at Microsoft
 
Meetup Oracle Database BCN: 2.1 Data Management Trends
Meetup Oracle Database BCN: 2.1 Data Management TrendsMeetup Oracle Database BCN: 2.1 Data Management Trends
Meetup Oracle Database BCN: 2.1 Data Management Trends
 
Indexing 3-dimensional trajectories: Apache Spark and Cassandra integration
Indexing 3-dimensional trajectories: Apache Spark and Cassandra integrationIndexing 3-dimensional trajectories: Apache Spark and Cassandra integration
Indexing 3-dimensional trajectories: Apache Spark and Cassandra integration
 
Data Analytics Domain
Data Analytics DomainData Analytics Domain
Data Analytics Domain
 

Destaque

Topic 4 intro spss_stata
Topic 4 intro spss_stataTopic 4 intro spss_stata
Topic 4 intro spss_stata
Sizwan Ahammed
 
Spss lecture notes
Spss lecture notesSpss lecture notes
Spss lecture notes
David mbwiga
 

Destaque (15)

NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
Retail Business Software
Retail Business SoftwareRetail Business Software
Retail Business Software
 
Supply Chain Analytic Solution
Supply Chain Analytic SolutionSupply Chain Analytic Solution
Supply Chain Analytic Solution
 
R-Excel Integration
R-Excel IntegrationR-Excel Integration
R-Excel Integration
 
Introduction to Cassandra (June 2010)
Introduction to Cassandra (June 2010)Introduction to Cassandra (June 2010)
Introduction to Cassandra (June 2010)
 
INTRODUCTION TO SAS
INTRODUCTION TO SASINTRODUCTION TO SAS
INTRODUCTION TO SAS
 
Topic 4 intro spss_stata
Topic 4 intro spss_stataTopic 4 intro spss_stata
Topic 4 intro spss_stata
 
Introduction to SAS
Introduction to SASIntroduction to SAS
Introduction to SAS
 
Sas demo
Sas demoSas demo
Sas demo
 
Predictive Analytics and Machine Learning …with SAS and Apache Hadoop
Predictive Analytics and Machine Learning…with SAS and Apache HadoopPredictive Analytics and Machine Learning…with SAS and Apache Hadoop
Predictive Analytics and Machine Learning …with SAS and Apache Hadoop
 
Introduction to EpiData
Introduction to EpiDataIntroduction to EpiData
Introduction to EpiData
 
SAS - Hortonworks: Creating the Omnichannel Experience in Retail webinar marc...
SAS - Hortonworks: Creating the Omnichannel Experience in Retail webinar marc...SAS - Hortonworks: Creating the Omnichannel Experience in Retail webinar marc...
SAS - Hortonworks: Creating the Omnichannel Experience in Retail webinar marc...
 
Spss lecture notes
Spss lecture notesSpss lecture notes
Spss lecture notes
 
Data analysis using spss
Data analysis using spssData analysis using spss
Data analysis using spss
 
Introduction to spss
Introduction to spssIntroduction to spss
Introduction to spss
 

Semelhante a Intro to R for SAS and SPSS User Webinar

2 it unit-1 start learning r
2 it   unit-1 start learning r2 it   unit-1 start learning r
2 it unit-1 start learning r
Netaji Gandi
 

Semelhante a Intro to R for SAS and SPSS User Webinar (20)

R vs SPSS: Which One is The Best Statistical Language
R vs SPSS: Which One is The Best Statistical LanguageR vs SPSS: Which One is The Best Statistical Language
R vs SPSS: Which One is The Best Statistical Language
 
Reason To learn & use r
Reason To learn & use rReason To learn & use r
Reason To learn & use r
 
R programming Language , Rahul Singh
R programming Language , Rahul SinghR programming Language , Rahul Singh
R programming Language , Rahul Singh
 
R_L1-Aug-2022.pptx
R_L1-Aug-2022.pptxR_L1-Aug-2022.pptx
R_L1-Aug-2022.pptx
 
R programming language
R programming languageR programming language
R programming language
 
The Statistical Significance of &quot;R&quot;
The Statistical Significance of &quot;R&quot;The Statistical Significance of &quot;R&quot;
The Statistical Significance of &quot;R&quot;
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programming
 
Introduction to R and R Studio
Introduction to R and R StudioIntroduction to R and R Studio
Introduction to R and R Studio
 
R programming
R programmingR programming
R programming
 
Big Data - Analytics with R
Big Data - Analytics with RBig Data - Analytics with R
Big Data - Analytics with R
 
R as supporting tool for analytics and simulation
R as supporting tool for analytics and simulationR as supporting tool for analytics and simulation
R as supporting tool for analytics and simulation
 
Study of R Programming
Study of R ProgrammingStudy of R Programming
Study of R Programming
 
R programming
R programmingR programming
R programming
 
Introtor
IntrotorIntrotor
Introtor
 
R Course Online
R Course OnlineR Course Online
R Course Online
 
2 it unit-1 start learning r
2 it   unit-1 start learning r2 it   unit-1 start learning r
2 it unit-1 start learning r
 
UNIT-1 Start Learning R.pdf
UNIT-1 Start Learning R.pdfUNIT-1 Start Learning R.pdf
UNIT-1 Start Learning R.pdf
 
Data Science - Part II - Working with R & R studio
Data Science - Part II -  Working with R & R studioData Science - Part II -  Working with R & R studio
Data Science - Part II - Working with R & R studio
 
1_Introduction.pptx
1_Introduction.pptx1_Introduction.pptx
1_Introduction.pptx
 
R program
R programR program
R program
 

Mais de Revolution Analytics

Reproducibility with Revolution R Open and the Checkpoint Package
Reproducibility with Revolution R Open and the Checkpoint PackageReproducibility with Revolution R Open and the Checkpoint Package
Reproducibility with Revolution R Open and the Checkpoint Package
Revolution Analytics
 

Mais de Revolution Analytics (20)

Speeding up R with Parallel Programming in the Cloud
Speeding up R with Parallel Programming in the CloudSpeeding up R with Parallel Programming in the Cloud
Speeding up R with Parallel Programming in the Cloud
 
Migrating Existing Open Source Machine Learning to Azure
Migrating Existing Open Source Machine Learning to AzureMigrating Existing Open Source Machine Learning to Azure
Migrating Existing Open Source Machine Learning to Azure
 
R in Minecraft
R in Minecraft R in Minecraft
R in Minecraft
 
The case for R for AI developers
The case for R for AI developersThe case for R for AI developers
The case for R for AI developers
 
Speed up R with parallel programming in the Cloud
Speed up R with parallel programming in the CloudSpeed up R with parallel programming in the Cloud
Speed up R with parallel programming in the Cloud
 
The R Ecosystem
The R EcosystemThe R Ecosystem
The R Ecosystem
 
R Then and Now
R Then and NowR Then and Now
R Then and Now
 
Reproducible Data Science with R
Reproducible Data Science with RReproducible Data Science with R
Reproducible Data Science with R
 
The Value of Open Source Communities
The Value of Open Source CommunitiesThe Value of Open Source Communities
The Value of Open Source Communities
 
Building a scalable data science platform with R
Building a scalable data science platform with RBuilding a scalable data science platform with R
Building a scalable data science platform with R
 
The Business Economics and Opportunity of Open Source Data Science
The Business Economics and Opportunity of Open Source Data ScienceThe Business Economics and Opportunity of Open Source Data Science
The Business Economics and Opportunity of Open Source Data Science
 
The Network structure of R packages on CRAN & BioConductor
The Network structure of R packages on CRAN & BioConductorThe Network structure of R packages on CRAN & BioConductor
The Network structure of R packages on CRAN & BioConductor
 
Simple Reproducibility with the checkpoint package
Simple Reproducibilitywith the checkpoint packageSimple Reproducibilitywith the checkpoint package
Simple Reproducibility with the checkpoint package
 
R at Microsoft
R at MicrosoftR at Microsoft
R at Microsoft
 
Revolution R Enterprise 7.4 - Presentation by Bill Jacobs 11Jun15
Revolution R Enterprise 7.4 - Presentation by Bill Jacobs 11Jun15Revolution R Enterprise 7.4 - Presentation by Bill Jacobs 11Jun15
Revolution R Enterprise 7.4 - Presentation by Bill Jacobs 11Jun15
 
Warranty Predictive Analytics solution
Warranty Predictive Analytics solutionWarranty Predictive Analytics solution
Warranty Predictive Analytics solution
 
Reproducibility with Checkpoint & RRO - NYC R Conference
Reproducibility with Checkpoint & RRO - NYC R ConferenceReproducibility with Checkpoint & RRO - NYC R Conference
Reproducibility with Checkpoint & RRO - NYC R Conference
 
Reproducibility with Revolution R Open and the Checkpoint Package
Reproducibility with Revolution R Open and the Checkpoint PackageReproducibility with Revolution R Open and the Checkpoint Package
Reproducibility with Revolution R Open and the Checkpoint Package
 
Reproducibility with Revolution R Open
Reproducibility with Revolution R OpenReproducibility with Revolution R Open
Reproducibility with Revolution R Open
 
In-Database Analytics Deep Dive with Teradata and Revolution
In-Database Analytics Deep Dive with Teradata and RevolutionIn-Database Analytics Deep Dive with Teradata and Revolution
In-Database Analytics Deep Dive with Teradata and Revolution
 

Último

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 

Último (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

Intro to R for SAS and SPSS User Webinar

  • 1.  What is R?  R’s Advantages  R’s Disadvantages  Installing and Maintaining R  Ways of Running R Bob Muenchen, Author R for SAS and SPSS Users,  An Example Program Co-Author R for Stata Users  Where to Learn More muenchen.bob@gmail.com, http://r4stats.com Copyright © 2010, 2011, Robert A Muenchen. All rights reserved. 2  “The most powerful statistical computing language on the planet.” -Norman Nie, Developer of SPSS  Language + package + environment for graphics and data analysis  Free and open source  Created by Ross Ihaka & Robert Gentleman 1996 & extended by many more  An implementation of the S language by John Chambers and others  R has 4,950 add-ons, or nearly 100,000 procs 3 4
  • 2. 5 Source: r4stats.com/popularity 6 http://r4stats.com/popularity 1. Data input & management (data step) * SAS Approach; 2. Analytics & graphics procedures (proc step) DATA A; SET A; 3. Macro language logX = log(X); 4. Matrix language PROC REG; 5. Output management systems (ODS/OMS) MODEL Y = logX; R integrates these all seamlessly. # R Approach lm( Y ~ log(X) ) 7 8
  • 3.  Vast selection of analytics & graphics  New methods are available sooner  Many packages can run R (SAS, SPSS, Excel…)  Its object orientation “does the right thing”  Its language is powerful & fully integrated  Procedures you write are on an equal footing  It is the universal language of data analysis  It runs on any computer  Being open source, you can study and modify it  It is free 9 10 * Using SAS;  Language is somewhat harder to learn PROC TTEST DATA=classroom;  Help files are sparse & complex CLASS gender;  Must find R and its add-ons yourself VAR score;  Graphical user interfaces not as polished  Most R functions hold data in main memory # In R  Rule-of-thumb: 10 million values per gigabyte t.test(score ~ gender, data=classroom)  SAS/SPSS: billions of records  Several efforts underway to break R’s memory limit t.test(posttest, pretest , paired=TRUE, data=classroom) including Revolution Analytics’ distribution 11 12
  • 4.  Base R plus Recommended Packages like:  Email support is free, quick, 24-hours:  Base SAS, SAS/STAT, SAS/GRAPH, SAS/IML Studio  www.r-project.org/mail.html  SPSS Stat. Base, SPSS Stat. Advanced, Regression  Stackoverflow.com  Tested via extensive validation programs  Quora.com  But add-on packages written by…  Crossvalidated stats.stackexchange.com  Professor who invented the method? /questions/tagged/r  A student interpreting the method?  Phone support available commercially 13 14 1. Go to cran.r-project.org,  Comprehensive R Archive Network the Comprehensive R Archive Network  Crantastic.com 2. Download binaries for Base & run  Inside-R.org 3. Add-ons:  R4Stats.com install.packages(“myPackage”) 4. To update: update.packages() 15 16
  • 5. 17 18 19 20
  • 6.  Run code interactively  Submit code from Excel, SAS, SPSS,…  Point-n-click using Graphical User Interfaces (GUIs)  Batch mode 21 22 23 24
  • 7. Copyright © 2010, 2011, Robert A Muenchen. All rights reserved. 26 25 run ExportDataSetToR("mydata"); GET FILE=‘mydata.sav’. BEGIN PROGRAM R. submit/r; mydata <- spssdata.GetDataFromSPSS( mydata$workshop <- variables = c("workshop gender factor(mydata$workshop) q1 to q4"), summary(mydata) missingValueToNA = TRUE, endsubmit; row.label = "id" ) summary(mydata) END PROGRAM. 27 28
  • 8. 29 30 32 31
  • 9. 34 33  A company focused on R development & support  Run by SPSS founder Norman Nie  Their enhanced distribution of R: Revolution R Enterprise  Free for colleges and universities, including for outside consulting 35
  • 10.
  • 11. 43 44
  • 12. mydata <- read.csv("mydata.csv") > mydata <- read.csv("mydata.csv") print(mydata) > print(mydata) workshop gender q1 q2 q3 q4 mydata$workshop <- factor(mydata$workshop) 1 1 f 1 1 5 1 summary(mydata) 2 2 f 2 1 4 1 plot( mydata$q1, mydata$q4 ) 3 1 f 2 2 4 3 4 2 <NA> 3 1 NA 3 myModel <- lm( q4~q1+q2+q3, data=mydata ) 5 1 m 4 5 2 4 summary( myModel ) 6 2 m 5 4 5 5 anova( myModel ) 7 1 m 5 3 4 4 plot( myModel ) 8 2 m 4 5 5 5 45 46 > mydata$workshop <-factor(mydata$workshop) > summary(mydata) workshop gender 1:4 f :3 2:4 m :4 NA's:1 q1 q2 q3 q4 Min. :1.00 Min. :1.00 Min. :2.000 Min. :1.00 1st Qu.:2.00 1st Qu.:1.00 1st Qu.:4.000 1st Qu.:2.50 Median :3.50 Median :2.50 Median :4.000 Median :3.50 Mean :3.25 Mean :2.75 Mean :4.143 Mean :3.25 3rd Qu.:4.25 3rd Qu.:4.25 3rd Qu.:5.000 3rd Qu.:4.25 Max. :5.00 Max. :5.00 Max. :5.000 Max. :5.00 NA's :1.000 47 48
  • 13. > myModel <- lm(q4 ~ q1+q2+q3, data=mydata) > summary(myModel) Call: lm(formula = q4 ~ q1 + q2 + q3, data = mydata) Residuals: 1 2 3 5 6 7 8 -0.3113 -0.4261 0.9428 -0.1797 0.0765 0.0225 -0.1246 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.3243 1.2877 -1.028 0.379 q1 0.4297 0.2623 1.638 0.200 q2 0.6310 0.2503 2.521 0.086 q3 0.3150 0.2557 1.232 0.306 Multiple R-squared: 0.9299, Adjusted R-squared: 0.8598 F-statistic: 13.27 on 3 and 3 DF, p-value: 0.03084 49 Copyright © 2010, 2011, Robert A Muenchen. All rights reserved. 50 51 52
  • 14.  R for SAS and SPSS Users, Muenchen  R for Stata Users, Muenchen & Hilbe  R Through Excel: A Spreadsheet Interface for Statistics, Data Analysis, and Graphics, Heiberger & Neuwirth  Data Mining with Rattle and R: The Art of Excavating Data for Knowledge Discovery, Williams 53 54  R is powerful, extensible, free  Download it from CRAN  Academics download Revolution R Enterprise for free at www.revolutionanalytics.com  You run it many ways & from many packages muenchen@utk.edu  Several graphical user interfaces are available  R's programming language is the way Slides: r4stats.com/misc/webinar Presentation: bit.ly/R-sas-spss to access its full power 55