SlideShare a Scribd company logo
1 of 14
Introduction to Statistical
Analysis Using R
Nick, Caroline, Tanya
What is R?
• R is a programming language for data
analysis and graphics
• All information about R is found on
http://www.R-project.org
• R system contains two major components:
1.Base system – contains the R language
software and the high priority add-on
packages listed on pg.3
2.User contributed add-on packages
Who uses R?
• All scientists especially those working in
developing countries
– It allows universal free access to state of the
art tools for statistical data analysis
– Most widely used for teaching undergraduates
and graduates statistics b/c the students can
use it free of cost
Installing R–Base System
1. Go to http://CRAN.R-project.org
2. Choose your computer from the list
(Linux, MacOS X, or Windows)
3. Click on Base (Base or Contrib)
4. Click on R-2.6.1-win32.exe
5. Save R
Getting Started
• Changing prompt - pg.3
• Example – using R as a pocket
calculator – pg.3
• Storing vs. Printing
• R is not space sensitive, but it is
case sensitive
Getting Help in R
• The Help system is a collection of manual
pages describing each function and data
set that comes with R
• Help/manual page is shown when the
name of the function we would like to get
help for is supplied to the help function
– Ex. help(“mean”) or help(mean) or ?mean
Installing add-on packages
• All packages are available on:
http://CRAN.R-
project.org/src/contrib/PACKAGES.html
– Pick package from list and download
• To install add-on package:
1. install.packages(“package name”)
2. library(“package name”)
Forbes2000 Example
• Go to http://CRAN.R-
project.org/src/contrib/PACKAGES.html and
select HSAUR from the list
• Choose what pertains to your computer ex.
Windows binary HSAUR 1.2-1.zip
• Save to desktop
• Find Forbes2000 list in rawdata folder
• Install in R :
– install.package(“HSAUR”)
– library(“HSAUR”)
Working with Data Sets – Ex.
Forbes 2000 list
• Vector – elementary structure for data handling in R; set
of simple elements, all being objects of the same class
– Ex. First 3 companies in Forbes -
Forbes2000[,"name"][1:3]
• Variable names – headings
– names(Forbes2000)
– Finding structures of data set – useful for large data
sets
• str(Forbes2000)
• Dimensions
– dim(Forbes2000)
– nrow(Forbes2000)
– ncol(Forbes2000)
Simple Summary Statistics
• Mean – mean(Forbes2000 [,”sales”])
• Median – median(Forbes2000 [,”assets”])
• Range – range(Forbes2000 [,”sales”])
Importing Data Not Part of a
Package
• When is this used?
– Most data sets are not part of a down-loadable
package
– Most people need to import their own data sets into R
• Example – Airport data (download to Desktop)
• In R:
– File → Change Dir → Desktop → OK
– name given < - read.table (“airport.csv”, header =
TRUE, sep = “,”, row.names =1
Making a Graph
• Graph of “Rank” of airport vs. “Shop”
• Plot (Rank ~ Shop, data = “name given”,
pch =“O”)
Homework
• Change Prompt “>” to “R>”
• Import Airport Data Set from Excel
• Print data set in R
• Find the Dimensions, the number of Columns,
and the number of Rows in the data set
• Find structure of data set
• Find median of category “Shop”
• Find mean of “Domestic”
Contact info
• Tanya – tgranch@luc.edu
• Caroline – cweber4@luc.edu
• Nick – ngundru@luc.edu

More Related Content

Similar to pres02a.ppt

Slides on introduction to R by ArinBasu MD
Slides on introduction to R by ArinBasu MDSlides on introduction to R by ArinBasu MD
Slides on introduction to R by ArinBasu MD
SonaCharles2
 
Presentation.pptx read and learn and download
Presentation.pptx read and learn and downloadPresentation.pptx read and learn and download
Presentation.pptx read and learn and download
Shubhamyadav41303
 

Similar to pres02a.ppt (20)

Introduction to basic statistics
Introduction to basic statisticsIntroduction to basic statistics
Introduction to basic statistics
 
BUSINESS ANALYTICS WITH R SOFTWARE DIAST
BUSINESS ANALYTICS WITH R SOFTWARE DIASTBUSINESS ANALYTICS WITH R SOFTWARE DIAST
BUSINESS ANALYTICS WITH R SOFTWARE DIAST
 
R introduction
R introductionR introduction
R introduction
 
محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي   R program د.هديل القفيديمحاضرة برنامج التحليل الكمي   R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
 
R programming Language , Rahul Singh
R programming Language , Rahul SinghR programming Language , Rahul Singh
R programming Language , Rahul Singh
 
Introduction to r
Introduction to rIntroduction to r
Introduction to r
 
Intro to R statistic programming
Intro to R statistic programming Intro to R statistic programming
Intro to R statistic programming
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programming
 
R - Get Started I - Sanaitics
R - Get Started I - SanaiticsR - Get Started I - Sanaitics
R - Get Started I - Sanaitics
 
Analytics Beyond RAM Capacity using R
Analytics Beyond RAM Capacity using RAnalytics Beyond RAM Capacity using R
Analytics Beyond RAM Capacity using R
 
17641.ppt
17641.ppt17641.ppt
17641.ppt
 
Slides on introduction to R by ArinBasu MD
Slides on introduction to R by ArinBasu MDSlides on introduction to R by ArinBasu MD
Slides on introduction to R by ArinBasu MD
 
17641.ppt
17641.ppt17641.ppt
17641.ppt
 
Up your data game: How to use R to wrangle, analyze, and visualize data faste...
Up your data game: How to use R to wrangle, analyze, and visualize data faste...Up your data game: How to use R to wrangle, analyze, and visualize data faste...
Up your data game: How to use R to wrangle, analyze, and visualize data faste...
 
An introduction to R is a document useful
An introduction to R is a document usefulAn introduction to R is a document useful
An introduction to R is a document useful
 
R Intro
R IntroR Intro
R Intro
 
Research paper presentation
Research paper presentation Research paper presentation
Research paper presentation
 
Presentation.pptx read and learn and download
Presentation.pptx read and learn and downloadPresentation.pptx read and learn and download
Presentation.pptx read and learn and download
 
Advanced Data Analytics with R Programming.ppt
Advanced Data Analytics with R Programming.pptAdvanced Data Analytics with R Programming.ppt
Advanced Data Analytics with R Programming.ppt
 
Intro to data science module 1 r
Intro to data science module 1 rIntro to data science module 1 r
Intro to data science module 1 r
 

Recently uploaded

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .ppt
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Ground Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementGround Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth Reinforcement
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 

pres02a.ppt

  • 1. Introduction to Statistical Analysis Using R Nick, Caroline, Tanya
  • 2. What is R? • R is a programming language for data analysis and graphics • All information about R is found on http://www.R-project.org • R system contains two major components: 1.Base system – contains the R language software and the high priority add-on packages listed on pg.3 2.User contributed add-on packages
  • 3. Who uses R? • All scientists especially those working in developing countries – It allows universal free access to state of the art tools for statistical data analysis – Most widely used for teaching undergraduates and graduates statistics b/c the students can use it free of cost
  • 4. Installing R–Base System 1. Go to http://CRAN.R-project.org 2. Choose your computer from the list (Linux, MacOS X, or Windows) 3. Click on Base (Base or Contrib) 4. Click on R-2.6.1-win32.exe 5. Save R
  • 5. Getting Started • Changing prompt - pg.3 • Example – using R as a pocket calculator – pg.3 • Storing vs. Printing • R is not space sensitive, but it is case sensitive
  • 6. Getting Help in R • The Help system is a collection of manual pages describing each function and data set that comes with R • Help/manual page is shown when the name of the function we would like to get help for is supplied to the help function – Ex. help(“mean”) or help(mean) or ?mean
  • 7. Installing add-on packages • All packages are available on: http://CRAN.R- project.org/src/contrib/PACKAGES.html – Pick package from list and download • To install add-on package: 1. install.packages(“package name”) 2. library(“package name”)
  • 8. Forbes2000 Example • Go to http://CRAN.R- project.org/src/contrib/PACKAGES.html and select HSAUR from the list • Choose what pertains to your computer ex. Windows binary HSAUR 1.2-1.zip • Save to desktop • Find Forbes2000 list in rawdata folder • Install in R : – install.package(“HSAUR”) – library(“HSAUR”)
  • 9. Working with Data Sets – Ex. Forbes 2000 list • Vector – elementary structure for data handling in R; set of simple elements, all being objects of the same class – Ex. First 3 companies in Forbes - Forbes2000[,"name"][1:3] • Variable names – headings – names(Forbes2000) – Finding structures of data set – useful for large data sets • str(Forbes2000) • Dimensions – dim(Forbes2000) – nrow(Forbes2000) – ncol(Forbes2000)
  • 10. Simple Summary Statistics • Mean – mean(Forbes2000 [,”sales”]) • Median – median(Forbes2000 [,”assets”]) • Range – range(Forbes2000 [,”sales”])
  • 11. Importing Data Not Part of a Package • When is this used? – Most data sets are not part of a down-loadable package – Most people need to import their own data sets into R • Example – Airport data (download to Desktop) • In R: – File → Change Dir → Desktop → OK – name given < - read.table (“airport.csv”, header = TRUE, sep = “,”, row.names =1
  • 12. Making a Graph • Graph of “Rank” of airport vs. “Shop” • Plot (Rank ~ Shop, data = “name given”, pch =“O”)
  • 13. Homework • Change Prompt “>” to “R>” • Import Airport Data Set from Excel • Print data set in R • Find the Dimensions, the number of Columns, and the number of Rows in the data set • Find structure of data set • Find median of category “Shop” • Find mean of “Domestic”
  • 14. Contact info • Tanya – tgranch@luc.edu • Caroline – cweber4@luc.edu • Nick – ngundru@luc.edu