Business Statistics: R tutorials

Size: px
Start display at page:

Download "Business Statistics: R tutorials"

Transcription

1 Business Statistics: R tutorials Jingyu He September 29, 2017

2 Install R and RStudio R is a free software environment for statistical computing and graphics. Download free R and RStudio for Windows/Mac: R: only commandline. RStudio: RStudio is a fancy interface. Cloud computing : all Booth students can get access to computing cluster login with your Booth ID, not CNetID. Note: R is necessary and RStudio makes your life easier. Install both!

3 Great tutorials A very short introduction to R org/doc/contrib/torfs+brauer-short-r-intro.pdf try R code school Introduction to R by Google playlist?list=plou2xlyxmsik9qqfztxeybphvru-trqap The best way to learn programming is... Use it!

4 Don t be afraid... R is just a big graphics calculator!

5 Essential reference

6 Coder s best friend

7 Rstudio interface

8 R Packages People make contribution to R community. They write their own code and build a package, post online and others can download it. Install packages: install.packages("package.name") After installation, you have to load it: library(package.name) You can also install and library R packages in the Packages tab. Get package information:?package.name

9 Package management

10 Learn R in R The swirl package is for interactive quizzes. It teaches you R programming interactively. install.packages("swirl") library(swirl) swirl() I highly encourage you to go through them by yourself if you are not familiar with R. (about 3 hours).

11 swirl modules 1: Basic Building Blocks 2: Workspace and Files 3: Sequences of Numbers 4: Vectors 5: Missing Values 6: Subsetting Vectors 7: Matrices and Data Frames 8: Logic 9: Functions 10: lapply and sapply 11: vapply and tapply 12: Looking at Data 13: Simulation 14: Dates and Times 15: Base Graphics

12 Basic R commands Working directory is a folder where you put your data file and code in. How to set working directory? View current working directory: getwd() Set new working directory: setwd(" /Document/LearnR")

13 Input and output data Make sure data files are under yoru working directory! Read local files data: data = read.table("filename.txt") or data = read.csv("filename.csv") Note: Make sure the files are in your working directory, otherwise you should enter the path: data = read.table(".../.../filename.txt") Read files data from websites directly: data = read.table(" Save data in.txt file: write.table(data, file = "filename.txt")

14 Input Data: Superbowl Example

15 Find document?functionname or help(functionname)

16 Data type R is a statistical software, most of the time you work with data! Frequently used data type scalar (numerical value) characters (or strings) vector (numerical vector or characters vector) matrix (all entries should be numerical) data frame (similar to matrix, allows different type entry)

17 Numerics and characters obj1 <- 1 obj2 <- "a" obj3 <- "hello world"

18 Vector Assignment Assign a vector: x = c(2,7,5), then type x and enter, [1] Replicate the values in x: rep(x,2), [1] Assign a natural sequence: x = 1:5, [1] Assign a vector with R command seq : x = seq(from=4,length=3,by=3), [1] Vector can contain characters x = c("hello", "world")

19 Vector Subsetting Let x = c(2,7,5), Get the 2nd value in x: x[2], [1] 7 Get the 2nd and 3rd values in x: x[2:3] or x[c(2,3)], [1] 7 5 Drop the 2nd value in x: x[-2], [1] 2 5 Drop the 2nd and 3rd values in x: x[-(2:3)] or x[-c(2,3)], [1] 2

20 Matrix Assign a matrix: z = matrix(seq(1,12),4,3,byrow = FALSE), [,1] [,2] [,3] [1,] [2,] [3,] [4,] Get the last 2 rows and last 2 columns: z[3:4,2:3], [,1] [,2] [1,] 7 11 [2,] 8 12

21 Basic Operations (element-by-element.) Let x = c(2,7,5) and y = c(4,7,10). Addition: x+y, [1] Multiplication: x*y, [1] Division: x/y, [1] Exponential function: exp(x), [1] Delete the variable x: rm(x)

22 Data frame Group a collection of related vectors. Most of the time, when data is loaded, it will be organized as a data frame. Take Boston as example

23 Distribution r.., q.., d.., p.. + distribution name norm, binom, exp, unif, gamma, beta Generate 5 standard Normal random numbers: rnorm(5,mean = 0,sd = 1) Density function : dnorm(x,mean = 0,sd = 1) Quantile function : qnorm(x,mean = 0,sd = 1) CDF function pnorm(x,mean = 0,sd = 1)

24 Basic statistics: Let x = 1:10; y = rnorm(10), Mean: mean(x) [1] 5.5 Median: median(x) [1] 5.5 Maximum: max(x) [1] 10 Minimum: min(x) [1] 1

25 Variance: var(x) [1] Covariance: cov(x,y) [1] Correlation: cor(x,y) [1]

26 Graphics Generate random numbers from U(0,1) and N(0,1): x = runif(50); y = rnorm(50) Plot x vs. y: plot(x,y,xlab="uniform",ylab="normal", main="random Data",col="blue") Random Data Normal Uniform?plot to see more about plot and customize figures.

27

28 Histogram Plot the histogram of y: hist(y), Histogram of y Frequency y

29 Box plot Plot the boxplot: boxplot(x,y),

A Quick Introduction to R

A Quick Introduction to R Math 4501 Fall 2012 A Quick Introduction to R The point of these few pages is to give you a quick introduction to the possible uses of the free software R in statistical analysis. I will only expect you

More information

GRAD6/8104; INES 8090 Spatial Statistic Spring 2017

GRAD6/8104; INES 8090 Spatial Statistic Spring 2017 Lab #1 Basics in Spatial Statistics (Due Date: 01/30/2017) PURPOSES 1. Get familiar with statistics and GIS 2. Learn to use open-source software R for statistical analysis Before starting your lab, create

More information

Introduction to R and R-Studio Toy Program #1 R Essentials. This illustration Assumes that You Have Installed R and R-Studio

Introduction to R and R-Studio Toy Program #1 R Essentials. This illustration Assumes that You Have Installed R and R-Studio Introduction to R and R-Studio 2018-19 Toy Program #1 R Essentials This illustration Assumes that You Have Installed R and R-Studio If you have not already installed R and RStudio, please see: Windows

More information

Basic Statistical Methods

Basic Statistical Methods Basic Statistical Methods Lecture 9 Nicholas Christian BIOST 2094 Spring 2011 Outline 1. Summary Statistics 2. Comparing Means 3. Comparing Variances 4. Comparing Proportions 5. Testing Normality 6. Testing

More information

Lab 1: Getting started with R and RStudio Questions? or

Lab 1: Getting started with R and RStudio Questions? or Lab 1: Getting started with R and RStudio Questions? david.montwe@ualberta.ca or isaacren@ualberta.ca 1. Installing R and RStudio To install R, go to https://cran.r-project.org/ and click on the Download

More information

R Programming Basics - Useful Builtin Functions for Statistics

R Programming Basics - Useful Builtin Functions for Statistics R Programming Basics - Useful Builtin Functions for Statistics Vectorized Arithmetic - most arthimetic operations in R work on vectors. Here are a few commonly used summary statistics. testvect = c(1,3,5,2,9,10,7,8,6)

More information

BIO5312: R Session 1 An Introduction to R and Descriptive Statistics

BIO5312: R Session 1 An Introduction to R and Descriptive Statistics BIO5312: R Session 1 An Introduction to R and Descriptive Statistics Yujin Chung August 30th, 2016 Fall, 2016 Yujin Chung R Session 1 Fall, 2016 1/24 Introduction to R R software R is both open source

More information

Handout #1. The abbreviations of FIVE references are PE, MPS, BR, FCDAE, and PRA. There is additional reference about the use of R (BR).

Handout #1. The abbreviations of FIVE references are PE, MPS, BR, FCDAE, and PRA. There is additional reference about the use of R (BR). Handout #1 Title: FAE Course: Econ 368/01 Spring/2015 Instructor: Dr. I-Ming Chiu The abbreviations of FIVE references are PE, MPS, BR, FCDAE, and PRA. There is additional reference about the use of R

More information

R is a programming language of a higher-level Constantly increasing amount of packages (new research) Free of charge Website:

R is a programming language of a higher-level Constantly increasing amount of packages (new research) Free of charge Website: Introduction to R R R is a programming language of a higher-level Constantly increasing amount of packages (new research) Free of charge Website: http://www.r-project.org/ Code Editor: http://rstudio.org/

More information

Introduction to R. Course in Practical Analysis of Microarray Data Computational Exercises

Introduction to R. Course in Practical Analysis of Microarray Data Computational Exercises Introduction to R Course in Practical Analysis of Microarray Data Computational Exercises 2010 March 22-26, Technischen Universität München Amin Moghaddasi, Kurt Fellenberg 1. Installing R. Check whether

More information

Getting Started. Slides R-Intro: R-Analytics: R-HPC:

Getting Started. Slides R-Intro:   R-Analytics:   R-HPC: Getting Started Download and install R + Rstudio http://www.r-project.org/ https://www.rstudio.com/products/rstudio/download2/ TACC ssh username@wrangler.tacc.utexas.edu % module load Rstats %R Slides

More information

Introduction to R Benedikt Brors Dept. Intelligent Bioinformatics Systems German Cancer Research Center

Introduction to R Benedikt Brors Dept. Intelligent Bioinformatics Systems German Cancer Research Center Introduction to R Benedikt Brors Dept. Intelligent Bioinformatics Systems German Cancer Research Center What is R? R is a statistical computing environment with graphics capabilites It is fully scriptable

More information

Statistics 251: Statistical Methods

Statistics 251: Statistical Methods Statistics 251: Statistical Methods Summaries and Graphs in R Module R1 2018 file:///u:/documents/classes/lectures/251301/renae/markdown/master%20versions/summary_graphs.html#1 1/14 Summary Statistics

More information

LECTURE NOTES FOR ECO231 COMPUTER APPLICATIONS I. Part Two. Introduction to R Programming. RStudio. November Written by. N.

LECTURE NOTES FOR ECO231 COMPUTER APPLICATIONS I. Part Two. Introduction to R Programming. RStudio. November Written by. N. LECTURE NOTES FOR ECO231 COMPUTER APPLICATIONS I Part Two Introduction to R Programming RStudio November 2016 Written by N.Nilgün Çokça Introduction to R Programming 5 Installing R & RStudio 5 The R Studio

More information

Description/History Objects/Language Description Commonly Used Basic Functions. More Specific Functionality Further Resources

Description/History Objects/Language Description Commonly Used Basic Functions. More Specific Functionality Further Resources R Outline Description/History Objects/Language Description Commonly Used Basic Functions Basic Stats and distributions I/O Plotting Programming More Specific Functionality Further Resources www.r-project.org

More information

Introduction to the R Language

Introduction to the R Language Introduction to the R Language Loop Functions Biostatistics 140.776 1 / 32 Looping on the Command Line Writing for, while loops is useful when programming but not particularly easy when working interactively

More information

Instruction: Download and Install R and RStudio

Instruction: Download and Install R and RStudio 1 Instruction: Download and Install R and RStudio We will use a free statistical package R, and a free version of RStudio. Please refer to the following two steps to download both R and RStudio on your

More information

Getting started with simulating data in R: some helpful functions and how to use them Ariel Muldoon August 28, 2018

Getting started with simulating data in R: some helpful functions and how to use them Ariel Muldoon August 28, 2018 Getting started with simulating data in R: some helpful functions and how to use them Ariel Muldoon August 28, 2018 Contents Overview 2 Generating random numbers 2 rnorm() to generate random numbers from

More information

Introduction to R. Hao Helen Zhang. Fall Department of Mathematics University of Arizona

Introduction to R. Hao Helen Zhang. Fall Department of Mathematics University of Arizona Department of Mathematics University of Arizona hzhang@math.aricona.edu Fall 2019 What is R R is the most powerful and most widely used statistical software Video: A language and environment for statistical

More information

Mails : ; Document version: 14/09/12

Mails : ; Document version: 14/09/12 Mails : leslie.regad@univ-paris-diderot.fr ; gaelle.lelandais@univ-paris-diderot.fr Document version: 14/09/12 A freely available language and environment Statistical computing Graphics Supplementary

More information

Introduction to R. Introduction to Econometrics W

Introduction to R. Introduction to Econometrics W Introduction to R Introduction to Econometrics W3412 Begin Download R from the Comprehensive R Archive Network (CRAN) by choosing a location close to you. Students are also recommended to download RStudio,

More information

Introduction to R. UCLA Statistical Consulting Center R Bootcamp. Irina Kukuyeva September 20, 2010

Introduction to R. UCLA Statistical Consulting Center R Bootcamp. Irina Kukuyeva September 20, 2010 UCLA Statistical Consulting Center R Bootcamp Irina Kukuyeva ikukuyeva@stat.ucla.edu September 20, 2010 Outline 1 Introduction 2 Preliminaries 3 Working with Vectors and Matrices 4 Data Sets in R 5 Overview

More information

Session 26 TS, Predictive Analytics: Moving Out of Square One. Moderator: Jean-Marc Fix, FSA, MAAA

Session 26 TS, Predictive Analytics: Moving Out of Square One. Moderator: Jean-Marc Fix, FSA, MAAA Session 26 TS, Predictive Analytics: Moving Out of Square One Moderator: Jean-Marc Fix, FSA, MAAA Presenters: Jean-Marc Fix, FSA, MAAA Jeffery Robert Huddleston, ASA, CERA, MAAA Predictive Modeling: Getting

More information

Introduction to R. Stat Statistical Computing - Summer Dr. Junvie Pailden. July 5, Southern Illinois University Edwardsville

Introduction to R. Stat Statistical Computing - Summer Dr. Junvie Pailden. July 5, Southern Illinois University Edwardsville Introduction to R Stat 575 - Statistical Computing - Summer 2016 Dr. Junvie Pailden Southern Illinois University Edwardsville July 5, 2016 Why R R offers a powerful and appealing interactive environment

More information

1 Lab 1. Graphics and Checking Residuals

1 Lab 1. Graphics and Checking Residuals R is an object oriented language. We will use R for statistical analysis in FIN 504/ORF 504. To download R, go to CRAN (the Comprehensive R Archive Network) at http://cran.r-project.org Versions for Windows

More information

MBV4410/9410 Fall Bioinformatics for Molecular Biology. Introduction to R

MBV4410/9410 Fall Bioinformatics for Molecular Biology. Introduction to R MBV4410/9410 Fall 2018 Bioinformatics for Molecular Biology Introduction to R Outline Introduce R Basic operations RStudio Bioconductor? Goal of the lecture Introduce you to R Show how to run R, basic

More information

Introduction to R gherardo varando

Introduction to R gherardo varando Introduction to R gherardo varando The R Software Environment As The R Project website states : and R is a free software environment for statistical computing and graphics. It compiles and runs on a wide

More information

Lecture 1: Getting Started and Data Basics

Lecture 1: Getting Started and Data Basics Lecture 1: Getting Started and Data Basics The first lecture is intended to provide you the basics for running R. Outline: 1. An Introductory R Session 2. R as a Calculator 3. Import, export and manipulate

More information

BGGN 213 Working with R packages Barry Grant

BGGN 213 Working with R packages Barry Grant BGGN 213 Working with R packages Barry Grant http://thegrantlab.org/bggn213 Recap From Last Time: Why it is important to visualize data during exploratory data analysis. Discussed data visualization best

More information

An Introduction to R- Programming

An Introduction to R- Programming An Introduction to R- Programming Hadeel Alkofide, Msc, PhD NOT a biostatistician or R expert just simply an R user Some slides were adapted from lectures by Angie Mae Rodday MSc, PhD at Tufts University

More information

R Programming: Worksheet 3

R Programming: Worksheet 3 R Programming: Worksheet 3 By the end of the practical you should feel confident writing and calling functions, and using if(), for() and while() constructions. 1. Review (a) Write a function which takes

More information

An introduction to R WS 2013/2014

An introduction to R WS 2013/2014 An introduction to R WS 2013/2014 Dr. Noémie Becker (AG Metzler) Dr. Sonja Grath (AG Parsch) Special thanks to: Dr. Martin Hutzenthaler (previously AG Metzler, now University of Frankfurt) course development,

More information

Introduction to R Jason Huff, QB3 CGRL UC Berkeley April 15, 2016

Introduction to R Jason Huff, QB3 CGRL UC Berkeley April 15, 2016 Introduction to R Jason Huff, QB3 CGRL UC Berkeley April 15, 2016 Installing R R is constantly updated and you should download a recent version; the version when this workshop was written was 3.2.4 I also

More information

Introduction to R. Daniel Berglund. 9 November 2017

Introduction to R. Daniel Berglund. 9 November 2017 Introduction to R Daniel Berglund 9 November 2017 1 / 15 R R is available at the KTH computers If you want to install it yourself it is available at https://cran.r-project.org/ Rstudio an IDE for R is

More information

Stochastic Models. Introduction to R. Walt Pohl. February 28, Department of Business Administration

Stochastic Models. Introduction to R. Walt Pohl. February 28, Department of Business Administration Stochastic Models Introduction to R Walt Pohl Universität Zürich Department of Business Administration February 28, 2013 What is R? R is a freely-available general-purpose statistical package, developed

More information

R: BASICS. Andrea Passarella. (plus some additions by Salvatore Ruggieri)

R: BASICS. Andrea Passarella. (plus some additions by Salvatore Ruggieri) R: BASICS Andrea Passarella (plus some additions by Salvatore Ruggieri) BASIC CONCEPTS R is an interpreted scripting language Types of interactions Console based Input commands into the console Examine

More information

ENGR 105: Introduction to Scientific Computing. Dr. Graham. E. Wabiszewski

ENGR 105: Introduction to Scientific Computing. Dr. Graham. E. Wabiszewski ENGR 105: Introduction to Scientific Computing Machine Model, Matlab Interface, Built-in Functions, and Arrays Dr. Graham. E. Wabiszewski ENGR 105 Lecture 02 Answers to questions from last lecture Office

More information

Advanced Econometric Methods EMET3011/8014

Advanced Econometric Methods EMET3011/8014 Advanced Econometric Methods EMET3011/8014 Lecture 2 John Stachurski Semester 1, 2011 Announcements Missed first lecture? See www.johnstachurski.net/emet Weekly download of course notes First computer

More information

Statistics 120 Statistical Computing With R. First Prev Next Last Go Back Full Screen Close Quit

Statistics 120 Statistical Computing With R. First Prev Next Last Go Back Full Screen Close Quit Statistics 120 Statistical Computing With R First Prev Next Last Go Back Full Screen Close Quit The R System This course uses the R computing environment for practical examples. R serves both as a statistical

More information

LAB #1: DESCRIPTIVE STATISTICS WITH R

LAB #1: DESCRIPTIVE STATISTICS WITH R NAVAL POSTGRADUATE SCHOOL LAB #1: DESCRIPTIVE STATISTICS WITH R Statistics (OA3102) Lab #1: Descriptive Statistics with R Goal: Introduce students to various R commands for descriptive statistics. Lab

More information

Part I { Getting Started & Manipulating Data with R

Part I { Getting Started & Manipulating Data with R Part I { Getting Started & Manipulating Data with R Gilles Lamothe February 21, 2017 Contents 1 URL for these notes and data 2 2 Origins of R 2 3 Downloading and Installing R 2 4 R Console and Editor 3

More information

Appendix A: A Sample R Session

Appendix A: A Sample R Session Appendix A: The purpose of this appendix is to become accustomed to the R and the way if responds to line commands. R can be downloaded from http://cran.r-project.org/ Be sure to download the version of

More information

Introduction to R Commander

Introduction to R Commander Introduction to R Commander 1. Get R and Rcmdr to run 2. Familiarize yourself with Rcmdr 3. Look over Rcmdr metadata (Fox, 2005) 4. Start doing stats / plots with Rcmdr Tasks 1. Clear Workspace and History.

More information

R Primer for Introduction to Mathematical Statistics 8th Edition Joseph W. McKean

R Primer for Introduction to Mathematical Statistics 8th Edition Joseph W. McKean R Primer for Introduction to Mathematical Statistics 8th Edition Joseph W. McKean Copyright 2017 by Joseph W. McKean at Western Michigan University. All rights reserved. Reproduction or translation of

More information

STAT 135 Lab 1 Solutions

STAT 135 Lab 1 Solutions STAT 135 Lab 1 Solutions January 26, 2015 Introduction To complete this lab, you will need to have access to R and RStudio. If you have not already done so, you can download R from http://cran.cnr.berkeley.edu/,

More information

Stat 290: Lab 2. Introduction to R/S-Plus

Stat 290: Lab 2. Introduction to R/S-Plus Stat 290: Lab 2 Introduction to R/S-Plus Lab Objectives 1. To introduce basic R/S commands 2. Exploratory Data Tools Assignment Work through the example on your own and fill in numerical answers and graphs.

More information

Release notes for StatCrunch mid-march 2015 update

Release notes for StatCrunch mid-march 2015 update Release notes for StatCrunch mid-march 2015 update A major StatCrunch update was made on March 18, 2015. This document describes the content of the update including major additions to StatCrunch that were

More information

R syntax guide. Richard Gonzalez Psychology 613. August 27, 2015

R syntax guide. Richard Gonzalez Psychology 613. August 27, 2015 R syntax guide Richard Gonzalez Psychology 613 August 27, 2015 This handout will help you get started with R syntax. There are obviously many details that I cannot cover in these short notes but these

More information

Modeling and Simulating Social Systems with MATLAB

Modeling and Simulating Social Systems with MATLAB Modeling and Simulating Social Systems with MATLAB Lecture 2 Statistics and Plotting in MATLAB Olivia Woolley, Tobias Kuhn, Dario Biasini, Dirk Helbing Chair of Sociology, in particular of Modeling and

More information

Module 1: Introduction RStudio

Module 1: Introduction RStudio Module 1: Introduction RStudio Contents Page(s) Installing R and RStudio Software for Social Network Analysis 1-2 Introduction to R Language/ Syntax 3 Welcome to RStudio 4-14 A. The 4 Panes 5 B. Calculator

More information

Introduction to R Programming

Introduction to R Programming Course Overview Over the past few years, R has been steadily gaining popularity with business analysts, statisticians and data scientists as a tool of choice for conducting statistical analysis of data

More information

Introduction to Statistics using R/Rstudio

Introduction to Statistics using R/Rstudio Introduction to Statistics using R/Rstudio R and Rstudio Getting Started Assume that R for Windows and Macs already installed on your laptop. (Instructions for installations sent) R on Windows R on MACs

More information

An introduction to R 1 / 29

An introduction to R 1 / 29 An introduction to R 1 / 29 What is R? R is an integrated suite of software facilities for data manipulation, calculation and graphical display. Among other things it has: an effective data handling and

More information

1 Pencil and Paper stuff

1 Pencil and Paper stuff Spring 2008 - Stat C141/ Bioeng C141 - Statistics for Bioinformatics Course Website: http://www.stat.berkeley.edu/users/hhuang/141c-2008.html Section Website: http://www.stat.berkeley.edu/users/mgoldman

More information

A Short Introduction to R

A Short Introduction to R A Short Introduction to R 1.1 The R initiative There are many commercial statistical softwares available. Well-known examples include SAS, SPSS, S-Plus, Minitab, Statgraphics, GLIM, and Genstat. Usually

More information

Introduction to MATLAB

Introduction to MATLAB UNIVERSITY OF CHICAGO Booth School of Business Bus 35120 Portfolio Management Prof. Lubos Pastor Introduction to MATLAB The purpose of this note is to help you get acquainted with the basics of Matlab.

More information

Author: Leonore Findsen, Qi Wang, Sarah H. Sellke, Jeremy Troisi

Author: Leonore Findsen, Qi Wang, Sarah H. Sellke, Jeremy Troisi 0. Downloading Data from the Book Website 1. Go to http://bcs.whfreeman.com/ips8e 2. Click on Data Sets 3. Click on Data Sets: PC Text 4. Click on Click here to download. 5. Right Click PC Text and choose

More information

A 30 Minute Introduction to Octave ENGR Engineering Mathematics Tony Richardson

A 30 Minute Introduction to Octave ENGR Engineering Mathematics Tony Richardson A 30 Minute Introduction to Octave ENGR 390 - Engineering Mathematics Tony Richardson Introduction This is a brief introduction to Octave. It covers several topics related to both the statistics and linear

More information

Statistics for Biologists: Practicals

Statistics for Biologists: Practicals Statistics for Biologists: Practicals Peter Stoll University of Basel HS 2012 Peter Stoll (University of Basel) Statistics for Biologists: Practicals HS 2012 1 / 22 Outline Getting started Essentials of

More information

Introduction to R statistical environment

Introduction to R statistical environment Introduction to R statistical environment R Nano Course Series Aishwarya Gogate Computational Biologist I Green Center for Reproductive Biology Sciences History of R R is a free software environment for

More information

Computing Skills Boot Camp Session August 2017 R Computing

Computing Skills Boot Camp Session August 2017 R Computing Computing Skills Boot Camp Session August 2017 R Computing The R Project: The R programming language is a statistical analysis system created by Robert Gentleman and Ross Ihaka. Derived from the S (SPlus)

More information

ACHIEVEMENTS FROM TRAINING

ACHIEVEMENTS FROM TRAINING LEARN WELL TECHNOCRAFT DATA SCIENCE/ MACHINE LEARNING SYLLABUS 8TH YEAR OF ACCOMPLISHMENTS AUTHORIZED GLOBAL CERTIFICATION CENTER FOR MICROSOFT, ORACLE, IBM, AWS AND MANY MORE. 8411002339/7709292162 WWW.DW-LEARNWELL.COM

More information

A (very) brief introduction to R

A (very) brief introduction to R A (very) brief introduction to R You typically start R at the command line prompt in a command line interface (CLI) mode. It is not a graphical user interface (GUI) although there are some efforts to produce

More information

Installing and Using R

Installing and Using R The National Animal Nutrition Program (NANP) Modeling Committee A National Research Support Project (NRSP-9) Supported by the Experiment Station Committee on Organization and Policy, The State Agricultural

More information

Introduction to R 21/11/2016

Introduction to R 21/11/2016 Introduction to R 21/11/2016 C3BI Vincent Guillemot & Anne Biton R: presentation and installation Where? https://cran.r-project.org/ How to install and use it? Follow the steps: you don t need advanced

More information

Computational statistics Jamie Griffin. Semester B 2018 Lecture 1

Computational statistics Jamie Griffin. Semester B 2018 Lecture 1 Computational statistics Jamie Griffin Semester B 2018 Lecture 1 Course overview This course is not: Statistical computing Programming This course is: Computational statistics Statistical methods that

More information

What is Matlab? The command line Variables Operators Functions

What is Matlab? The command line Variables Operators Functions What is Matlab? The command line Variables Operators Functions Vectors Matrices Control Structures Programming in Matlab Graphics and Plotting A numerical computing environment Simple and effective programming

More information

An Introduction to Statistical Computing in R

An Introduction to Statistical Computing in R An Introduction to Statistical Computing in R K2I Data Science Boot Camp - Day 1 AM Session May 15, 2017 Statistical Computing in R May 15, 2017 1 / 55 AM Session Outline Intro to R Basics Plotting In

More information

Simple Introduction to R. Rob McCulloch

Simple Introduction to R. Rob McCulloch Simple Introduction to R Rob McCulloch 1. Installing R 2. First R 3. Getting Your Data Into R 4. Simple Statistics in R 5. Using Files of Commands 6. Factors and Tables 7. Getting Help in R 8. Simple Linear

More information

R Programming for Computational Linguists and Similar Creatures

R Programming for Computational Linguists and Similar Creatures R Programming for Computational Linguists and Similar Creatures Marco Baroni 1 and Stefan Evert 2 1 Center for Mind/Brain Sciences University of Trento 2 Cognitive Science Institute University of Onsabrück

More information

Making plots in R [things I wish someone told me when I started grad school]

Making plots in R [things I wish someone told me when I started grad school] Making plots in R [things I wish someone told me when I started grad school] Kirk Lohmueller Department of Ecology and Evolutionary Biology UCLA September 22, 2017 In honor of Talk Like a Pirate Day...

More information

Introduction to R: Using R for statistics and data analysis

Introduction to R: Using R for statistics and data analysis Why use R? Introduction to R: Using R for statistics and data analysis George W Bell, Ph.D. BaRC Hot Topics November 2014 Bioinformatics and Research Computing Whitehead Institute http://barc.wi.mit.edu/hot_topics/

More information

R Introduction 1. J.M. Ponciano. August 17, Objects in Splus language include, and. x<-list(ncolors=2,colors=c("red","blue"))

R Introduction 1. J.M. Ponciano. August 17, Objects in Splus language include, and. x<-list(ncolors=2,colors=c(red,blue)) R Introduction 1 J.M. Ponciano August 17, 2007 1 Objects and types Location, definition of, and permanence of data Objects in Splus language include, and. Objects are created by assignment statements:

More information

Basic C++ through Rcpp

Basic C++ through Rcpp Basic C++ through Rcpp Advanced Statistical Programming Camp Jonathan Olmsted (Q-APS) Day 3: May 29th, 2014 PM Session ASPC Basic C++ through Rcpp Day 3 PM 1 / 30 Outline 1 Practice 2 Rcpp Sugar 3 RNG

More information

Weekly Discussion Sections & Readings

Weekly Discussion Sections & Readings Weekly Discussion Sections & Readings Teaching Fellows (TA) Name Office Email Mengting Gu Bass 437 mengting.gu (at) yale.edu Paul Muir Bass437 Paul.muir (at) yale.edu Please E-mail cbb752@gersteinlab.org

More information

R package

R package R package www.r-project.org Download choose the R version for your OS install R for the first time Download R 3 run R MAGDA MIELCZAREK 2 help help( nameofthefunction )? nameofthefunction args(nameofthefunction)

More information

INF-STK 5010 Clustering (part 2)

INF-STK 5010 Clustering (part 2) INF-STK 5010 Clustering (part 2) Ole Christian Lingjærde Ole Christian Lingjærde Division for Biomedical Informatics Dept of Computer Science, UiO Where we stand now Heatmaps are popular for visualization

More information

Numerical Methods 5633

Numerical Methods 5633 Numerical Methods 5633 Lecture 1 Marina Krstic Marinkovic marina.marinkovic@cern.ch School of Mathematics Trinity College Dublin Marina Krstic Marinkovic 1 / 15 5633-Numerical Methods R programming https://www.r-project.org/

More information

Introduction to scientific programming in R

Introduction to scientific programming in R Introduction to scientific programming in R John M. Drake & Pejman Rohani 1 Introduction This course will use the R language programming environment for computer modeling. The purpose of this exercise

More information

Basic MATLAB Tutorial

Basic MATLAB Tutorial Basic MATLAB Tutorial http://www1gantepedutr/~bingul/ep375 http://wwwmathworkscom/products/matlab This is a basic tutorial for the Matlab program which is a high-performance language for technical computing

More information

#a- a vector of 100 random number from a normal distribution a<-rnorm(100, mean= 32, sd=6)

#a- a vector of 100 random number from a normal distribution a<-rnorm(100, mean= 32, sd=6) 1 Transition to R Class 3: Basic functions for descriptive statistics and summarizing data Use simple functions and Xapply functions for summarizing and describing data Goals: (1) Summarizing continuous

More information

STA 248 S: Some R Basics

STA 248 S: Some R Basics STA 248 S: Some R Basics The real basics The R prompt > > # A comment in R. Data To make the variable x equal to 2 use > x x = 2 To make x a vector, use the function c() ( c for concatenate)

More information

Why use R? Getting started. Why not use R? Introduction to R: It s hard to use at first. To perform inferential statistics (e.g., use a statistical

Why use R? Getting started. Why not use R? Introduction to R: It s hard to use at first. To perform inferential statistics (e.g., use a statistical Why use R? Introduction to R: Using R for statistics ti ti and data analysis BaRC Hot Topics November 2013 George W. Bell, Ph.D. http://jura.wi.mit.edu/bio/education/hot_topics/ To perform inferential

More information

Dynamics and Vibrations Mupad tutorial

Dynamics and Vibrations Mupad tutorial Dynamics and Vibrations Mupad tutorial School of Engineering Brown University ENGN40 will be using Matlab Live Scripts instead of Mupad. You can find information about Live Scripts in the ENGN40 MATLAB

More information

EE 301 Signals & Systems I MATLAB Tutorial with Questions

EE 301 Signals & Systems I MATLAB Tutorial with Questions EE 301 Signals & Systems I MATLAB Tutorial with Questions Under the content of the course EE-301, this semester, some MATLAB questions will be assigned in addition to the usual theoretical questions. This

More information

The goal of this handout is to allow you to install R on a Windows-based PC and to deal with some of the issues that can (will) come up.

The goal of this handout is to allow you to install R on a Windows-based PC and to deal with some of the issues that can (will) come up. Fall 2010 Handout on Using R Page: 1 The goal of this handout is to allow you to install R on a Windows-based PC and to deal with some of the issues that can (will) come up. 1. Installing R First off,

More information

The "R" Statistics library: Research Applications

The R Statistics library: Research Applications Edith Cowan University Research Online ECU Research Week Conferences, Symposia and Campus Events 2012 The "R" Statistics library: Research Applications David Allen Edith Cowan University Abhay Singh Edith

More information

Experimental epidemiology analyses with R and R commander. Lars T. Fadnes Centre for International Health University of Bergen

Experimental epidemiology analyses with R and R commander. Lars T. Fadnes Centre for International Health University of Bergen Experimental epidemiology analyses with R and R commander Lars T. Fadnes Centre for International Health University of Bergen 1 Click to add an outline 2 How to install R commander? - install.packages("rcmdr",

More information

An Introduction to the R Commander

An Introduction to the R Commander An Introduction to the R Commander BIO/MAT 460, Spring 2011 Christopher J. Mecklin Department of Mathematics & Statistics Biomathematics Research Group Murray State University Murray, KY 42071 christopher.mecklin@murraystate.edu

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB What you will learn The most important commands (from my view) Writing scripts (.m files) Defining MATLAB variables Matrix/array operations Importing and extracting data 2D plots

More information

No Name What it does? 1 attach Attach your data frame to your working environment. 2 boxplot Creates a boxplot.

No Name What it does? 1 attach Attach your data frame to your working environment. 2 boxplot Creates a boxplot. No Name What it does? 1 attach Attach your data frame to your working environment. 2 boxplot Creates a boxplot. 3 confint A metafor package function that gives you the confidence intervals of effect sizes.

More information

Statistics Lecture 6. Looking at data one variable

Statistics Lecture 6. Looking at data one variable Statistics 111 - Lecture 6 Looking at data one variable Chapter 1.1 Moore, McCabe and Craig Probability vs. Statistics Probability 1. We know the distribution of the random variable (Normal, Binomial)

More information

Regression on SAT Scores of 374 High Schools and K-means on Clustering Schools

Regression on SAT Scores of 374 High Schools and K-means on Clustering Schools Regression on SAT Scores of 374 High Schools and K-means on Clustering Schools Abstract In this project, we study 374 public high schools in New York City. The project seeks to use regression techniques

More information

POL 345: Quantitative Analysis and Politics

POL 345: Quantitative Analysis and Politics POL 345: Quantitative Analysis and Politics Precept Handout 1 Week 2 (Verzani Chapter 1: Sections 1.2.4 1.4.31) Remember to complete the entire handout and submit the precept questions to the Blackboard

More information

Index. Bar charts, 106 bartlett.test function, 159 Bottles dataset, 69 Box plots, 113

Index. Bar charts, 106 bartlett.test function, 159 Bottles dataset, 69 Box plots, 113 Index A Add-on packages information page, 186 187 Linux users, 191 Mac users, 189 mirror sites, 185 Windows users, 187 aggregate function, 62 Analysis of variance (ANOVA), 152 anova function, 152 as.data.frame

More information

Intro to R. Fall Fall 2017 CS130 - Intro to R 1

Intro to R. Fall Fall 2017 CS130 - Intro to R 1 Intro to R Fall 2017 Fall 2017 CS130 - Intro to R 1 Intro to R R is a language and environment that allows: Data management Graphs and tables Statistical analyses You will need: some basic statistics We

More information

Why use R? Getting started. Why not use R? Introduction to R: Log into tak. Start R R or. It s hard to use at first

Why use R? Getting started. Why not use R? Introduction to R: Log into tak. Start R R or. It s hard to use at first Why use R? Introduction to R: Using R for statistics ti ti and data analysis BaRC Hot Topics October 2011 George Bell, Ph.D. http://iona.wi.mit.edu/bio/education/r2011/ To perform inferential statistics

More information

file:///users/williams03/a/workshops/2015.march/final/intro_to_r.html

file:///users/williams03/a/workshops/2015.march/final/intro_to_r.html Intro to R R is a functional programming language, which means that most of what one does is apply functions to objects. We will begin with a brief introduction to R objects and how functions work, and

More information

Using R for statistics and data analysis

Using R for statistics and data analysis Introduction ti to R: Using R for statistics and data analysis BaRC Hot Topics October 2011 George Bell, Ph.D. http://iona.wi.mit.edu/bio/education/r2011/ Why use R? To perform inferential statistics (e.g.,

More information

This is a basic tutorial for the MATLAB program which is a high-performance language for technical computing for platforms:

This is a basic tutorial for the MATLAB program which is a high-performance language for technical computing for platforms: Appendix A Basic MATLAB Tutorial Extracted from: http://www1.gantep.edu.tr/ bingul/ep375 http://www.mathworks.com/products/matlab A.1 Introduction This is a basic tutorial for the MATLAB program which

More information