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

Size: px
Start display at page:

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

Transcription

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

2

3 Introduction to R Programming 5 Installing R & RStudio 5 The R Studio Layout 7 History Tab 8 Environment (Workspace) Tab 8 R Script 8 File Tab 9 Plots Tab 9 Packages Tab 10 Help Tab 11 Viewer Tab 12 Changing the Working Directory 12 Using The Console for Basic Calculations 13 Vectors 15 What is Vector? 15 Summary-type Statistics 17 Matrices & Data Frames 18 Importing data from Excel to RStudio 20 Generic Summary of the Data 23 Use of Square Bracket 23 Multiple Logical Statement 24 Summary Statistics in R Studio 26 Plots in R Studio 27 Scatterplots 27 Barchart 29 Box Plots 30 Histogram in R Studio 31

4

5 Introduction to R Programming Installing R & RStudio R is the name of the programming language itself and R Studio is a convenient interface. RStudio is a free and open source integrated development environment (IDE) for R, a programming language for statistical computing and graphics. RStudio is available in two editions: RStudio Desktop, where the program is run locally as a regular desktop application; and RStudio Server, which allows accessing RStudio using a web browser while it is running on a remote Linux server. Prepackaged distributions of RStudio Desktop are available for Microsoft Windows, Mac OS X, and Linux. If you don t have either R or R Studio installed, please go to to download the appropriate version of R for your computer, and for R Studio. These are relatively large installs so they make take a few minutes to download and install. Both should still run smoothly even on older computers too. You can install RStudio to your computer after installing the R Project. And we already learn about how to install R (Lecturer Notes: Part One) The Official website for R Studio is At the end of this lecture you should be able to: ~ Open R Studio ~ Load data into R ~ Understand the different types of variables ~ Get some basic plots and summary statistics ~ Save your commands for later use.

6 Please select suitable version for your work. There is no difference installing RStudio to Mac or Windows. Select operating system, and install RStudio to your computer. 6

7 The R Studio Layout I. The Console is where you can type commands and see output II. The Environment (Workspace) tab shows all the active objects. The History tab shows a list of commands used so far. III. The Files tab shows all the files and folders in your default workspace as if you were on a PC/Mac window. The Plots tab will show all your graphs. The Packages tab will list a series of packages or add-ons needed to run certain processes. For additional info see the help tab. 7

8 RStudio has 3 windows, Console that we write functions and calculations. Environment shows values and results of Console. On the last window you could see the menu bars of Files, Plots, Packages, Help and Viewer. History Tab The history tab keeps a record of all previous commands. It helps when testing and running processes. Here you can either save the whole list or you can select the commands you want and send them to an R Script to keep track of your work. Environment (Workspace) Tab The workspace tab stores any object, value, function or anything you create during your R session. Here is another example on how the workspace looks like when more objects are added. R Script The usual R Studio screen has four windows: 1. Console. 2. Workspace and history. 3. Files, plots, packages and help. 4. The R script(s) and data view. The R script is where you keep a record of your work. For Stata users this would be like the dofile, for SPSS users is like the syntax and for SAS users the SAS program. 8

9 To create a new R script, you can either go to File -> New -> R script, or click on the icon with the + sign and select R Script, or simply press Ctrl+Shift+N. Make sure to save the script. File Tab The Files & directory structure of your current working directory. Plots Tab The plots tab will display the graphs. If you want to see more graph that you make, you can click to back arrow key on screen. To extract the graph, click on Export where you can save the file as an image (PNG, JPG, etc.) or as PDF, these options are useful when you only want to share the graph or use it in a LaTeX document. Probably, the easiest way to export a graph is by copying it to the clipboard and then paste it directly into your Word document. Export -> Copy to Clipboard Make sure to select Metafile 9

10 Paste it into your Word document. Your graph will look like this X D graphs will display on a separate screen. You won t be able to save it, but after moving it around, once you find the angle you want, you can screenshot it and paste it to Word document. In particular: Index 1. Ctrl-Enter (submit current line or selection in editor window to console) 2. Ctrl-1 (move cursor to editor window) 3. Ctrl-2 (move cursor to console) 4. Ctrl-6 (move cursor to plots) 5. Esc (interrupt currently executing command) Packages Tab The packages tab shows the list of add-ons included in the installation of RStudio. If checked, the package is loaded into R, if not, any command related to that package won t work, you will need select it. You can also install other add-ons by clicking on the Install Packages icon. 10

11 Installing a package; for example, installing the package rgl (useful to plot 3D images). It does not come with the original R install. Click on Install Packages, write the name in the pop-up window and click on Install. package. after installing R Studio is a computing environment where statistical techniques may be implemented. Packages are add-ons that can extend R s functionally and perform specific tasks covering a wide range of modern statistics packages are available in R Studio. > install.packages ( Ecdat ) Mirror Selection : 69 > install.packages () # will open packages lists. > library (Ecdat) If you type help for package > help (package=ecdat) # will open help menu for package on the right window. > remove.packages (Ecdat) # to remove package. By menu to install packages Tools Install package. Help Tab Where you can find the help pages for every function installed in your version of R. 11

12 Viewer Tab Used for displaying locally generated.html content. Changing the Working Directory Working directories are useful for keeping your work organized. A working directory is one spot (e.g. a folder) that you have created for saving all of your work. If you have different projects, you can change the working directory for that session. getwd ( ) setwd ( ) # shows the working directory (wd) # Changes the wd Every time you open RStudio, it goes to a default directory. You can change the default to a folder where you have your datafiles so you do not have to do it every time. In the menu go to Tools -> Options 12

13 Using The Console for Basic Calculations We will discuss assigning values to objects in R, basic arithmetic functions, and a few other handy things to know. RStudio is case sensitive like R Console. You will see that there are not many differences between R Console and RStudio. RStudio can be used as a calculator and also has a series of inbuilt functions. Note that any comment lines are prefixed with a hash symbol (#). R usually outputs any results prefixed by a number in square brackets. e.g. [1] Equal sign (=) or less than sign and dash (<-) are same for assigning values. Assigning 25 to x > x = 25 > x [1] 25 Assigning 9 to y > y <-9 Assigning x+y to z > z <-x+y > z [1] 34 As you see on Environment window the assigned letter shown. The environment window is Workspace of RStudio. 13

14 There are also a series of inbuilt functions in the R console, so let s have a look at some familiar ones to begin with. To find the square-root of a value, we can use the function sqrt ( ) or we could take it to the power of 0.5. Note that R is a case-sensitive language so sqrt is different to SQRT. sqrt(4) or alternatively 4^0.5 To take the power of something, we use the caret symbol (^) 2^3 Note that in the above, we passed the value 4 to the function sqrt by enclosing it in round brackets. this is how we pass data to a function in R. Spaces are typically not meaningful in R but the convention is to place these brackets directly after the function name, unlike in some command-line based functions. We also use square brackets [ ] and curly brackets { }. Similarly, there is an inbuilt function for finding the logarithm of a number. The default is to find the natural logarithm (i.e. ln) but we can change this by specifying the base as in the second example. log(8) [1] # Now try using here 2 log(8, 2) [1] 3 To see the variables in workspace you can use ls( ) list command. Or to clear any value you may type rm(z) to console. > ls () [1] x y z > rm(z) Object names in RStudio may include numbers but cannot start with numbers. You may name x1 but you cannot name 1x. Unexpected symbol in 1x Creating vectors, matrices, and performing some simple operations on them We may assign 11 to x, or we may create a vector x1 <- c(1,3,5,7,9) 14

15 Vectors Most of us are probably used to Excel where we can see all of the data by just scrolling down the spreadsheet. Unfortunately, Excel has strict limits on the size of your spreadsheet, whereas in R the only bounds are defined by the memory of your computer, and even then many packages have developed ways of enabling you to access dataset with millions of data points even on very limited computers. > x <-11 > x [1] 11 What is Vector? In R we often have data contained in vectors, and for these who start to get nervous around mathematics these are just a collection of values. More formally, they are objects in the Environment (or workspace) with are one-dimensional and all of the elements of the vector will be of the same data type. We can also think them as being analogous to a single column of data in an Excel spreadsheet. > x1 <- c(1, 3, 5, 7, 9) > x1 [1] A simple vector is the numbers 1 to 10, and we can obtain this vector just by going to the Console and typing: > 1:10 [1] Let s get a bit more serious now and move to the Script Window by entering Ctrl+1. Type the text x <- 1:10 then hit Ctrl+Enter. This will send the current line from the Script Window to the Console. # just display the second value in the vector x [2] [1] 2 15

16 # Show the first three values x[1:3] [1] > gender <-c( male, female ) > gender [1] male female We may create two vectors and work on these vectors X = 1, 2, 3, 4, 5 and Y = 1, 3, 5, 7, 9 > x <-1:5 > x [1] > > y<-c(1,3,5,7,9) > y [1] > > x+10 [1] > > x-10 [1] > > x*10 [1] > > x/2 [1] If two vectors are of the same length, we may add/substract/mult/div corresponding elements. We may add vectors or subtracts > x [1] > y [1] > > x+y [1] > > x-y [1]

17 > > x*y [1] > > x/y [1] Summary-type Statistics We can obtain the simple summary types of statistics for our vector x using some relatively intuitive commands. A few example is: max(x) min(x) sum(x) mean(x) median(x) Each number in the vector x is referred to as an element of x, and R is particularly useful for performing the same operation on every element within a vector, e.g. x/2 n <-length (x) y <- rep(0,n) # find the length of a vector # create an empty vector to hold the results Descriptive Statistics (location) Mean The mean is the sum of the observations divided by the total number of observations. X = X i n Excel R-R Studio =AVERAGE(range of cells) mean(x) Median The median is another measure of central tendency. To get the median you have to order the data from lowest to highest. The median is the number in the middle. If the number of cases is odd the median is the single value, for even number of cases the median is the average of the two numbers in the middle Excel R-R Studio =MEDIAN(range of cells) median(x) Descriptive Statistics (variability) Variance The variance measures the dispersion of the data from the mean. It is the simple mean of the squared distance from the mean. s 2 = (X i X ) 2 n 1 Excel R-R Studio =VAR(range of cells) var(x) 17

18 Standard Deviation The standard deviation is the squared root of the variance. Indicates have close the data is to the mean. Assuming a normal distribution:. 68% of the value are within 1 sd (.99). 95% within 2 sd (1.96). 99% within 3 sd (2.58) s = (X i X ) 2 n 1 Excel R-R Studio =STDEV(range of cells) sd(x) Range Range is a measure of dispersion. It is simple the difference between the largest and smallest value, max - min. range=(max(x)-min(x)) R-RStudio range Matrices & Data Frames Just as a vector was a collection of values of the same data types, a matrix is the same but with two dimensions. We can create a simple matrix by placing the following code in the Script window and hitting Ctrl+Enter. xmat <-matrix (1:20, ncol=4) Note that by specifying the number of columns the function automatically decided the number of rows, and that it filled the matrix down each column by default. Firstly, whilst a vector only has a length attribute, matrices have a length attribute and a dimension attribute. length(x) dim(x) length(xmat) dim(xmat) ıf we shift our attention to the Environment Tab in the upper-right window, we ll see that xmat is defined as integers but the square brackets now contain the values [1:15, 1:4]. The first values indicate the rows, whilst the second values denote the columns. Just like with a vector, we can extract individual rows, column or even single entries by using these indices. xmat[1, ] xmat[,1] xmat[2,3] # Show the first row # Show the first column # Show the 2 nd entry in the 3 rd column. 18

19 To create matrix, we use matrix function > matrix(c(1,2,3,4,5,6,7,8,9), nrow=3,byrow=true) [,1] [,2] [,3] [1,] [2,] [3,] > matrix(c(1,2,3,4,5,6,7,8,9), nrow=3,byrow=false) [,1] [,2] [,3] [1,] [2,] [3,] > mat<-matrix(c(1,2,3,4,5,6,7,8,9), nrow=3,byrow=true) > mat [,1] [,2] [,3] [1,] [2,] [3,] > mat[1,2] [1] 2 > mat[c(1,3),2] [1]

20 Importing data from Excel to RStudio R is a very powerful analytic environment with near limitless number of packages and functions. It s also a good idea to make sure you are now working in the Script Window Ctrl+1, and entering everything into the Console using Ctrl+Enter. To begin this section, open a new R Script File (Ctrl+Shift+N) and save it as ReadsData.R The steps outlined here are the same for most other spreadsheet applications. Two main options are to save data file as: Comma separated value: *.csv by default it will open in Excel Tab delimited text file: *.txt by default it will open in Text editor. Saving as.csv file easy way to go Let s save our Excel file to desktop as CSV file. To import data to RStudio open the program. Then you can write the command below: Name your dataset in RStudio as data1 >data1 <-read.csv(file.choose(), header=true) # with column headings Header=TRUE means R will take first row as header. >data1 The other way to write command as: >data2 <-read.table(file.choose(), header=t, sep=, ) 20

21 >data2 Let s save the same file as tab delimited text file. Save As Tab delimited text (.txt) In RStudio >data3 <-read.delim(file.choose(),header=t) >data3 You can still open this data as read.table command. >data4 <-read.table(file.choose(), header=t, sep= \t ) >data4 #Read in the Data Getting started with Data in RStudio RStudio let us to select file from ImportDataSet. By Import DataSet dialog box you can select your file. Name Heading Separator : Data name that you would like to select : If you have datanames in Excel file. : Let R know how data has separate. Whitespace Comma Semicolon Tab Decimal : which character will have specified decimal point. Period comma Quate : Double quate ( ) >view (DataSet) View command will open a spreadsheet view on top. You may remove other imported data sets (data1, data2, data3, ext.) >rm (data1) >rm (data2) 21

22 rm command will remove data set from workplace. Dim dimension of dataset >dim (DataSet) 725 rows 6 data >head (DataSet) >tail (DataSet) # first 6 rows # last 6 rows >DataSet [c(5,6,7,8,9), ] Show rows 5,6,7,8,9 and all columns >DataSet[5:9,] Show rows 5,6,7,8,9 and all columns >DataSet[-c(4:722),] Write all rows except 4 to 722 # Check the names >names (DataSet) Will give us name of variables in DataSet >mean (Age) error Error in mean(age) : object Age not found. That s because R doesn t recognize Age variable. There are two options here 1) >mean(dataset $Age) >DataSet$Age says RStudio where to find Age variable. 2) Attach(DataSet) Second way to work on DataSet easily, and you may use mean command: 3) >mean(age) >detach(dataset) will let you go back. It is personal preference to use any way to work on DataSet. > attach (LungCapData) > names (LungCapData) > class (LungCap) numeric 22

23 > class (Age) integer > class (Smoke) factor * * * > levels (Smoke) no yes Generic Summary of the Data > summary (LungCap) For numeric variables it gives mean, median, max etc. for factor variables summaries for frequency. > X <-c(0,1,1,1,0,0,0,0,0,0) > class (X) numeric > summary (X) min 1stQu Median Mean > X <-as.factor (X) > class (X) factor > summary (X) Use of Square Bracket > Age [11:14] # will give all observation for 11 up to 14 > LungCap [11:14,] # will give matrix of row 11 up to 14 for all columns. In RStudio = (equal sign) is used to assign values to objects. == (double equal sign) is used to represent the meaning of equality in a mathematical sense. We would like to calculate mean of Age we can use the square bracket to subset only females. > mean (Age[Gender00 female ]) > mean (Age [Gender== male ]) ) If we would like to create a dataset that contains only Female > FemData <-LungCapData[Gender== female, ] #space include all column 23

24 2) If we would like to create a dataset that contains only male > MaleData <-LungCapData[Gender== male, ] 3) Dimension of FemaleData > dim(femdata) ) Dimension of MaleData > dim (MaleData) > summary (Gender) Female Male > FemData [1:4,] # first 4 rows for all columns Let s take this one step further, we will subset data for male over 15 years old. > MaleOver15 <-LungCapData[Gender== male & Age>15, ] > dim (MaleOver15) 89 6 > MaleOver15[1:4, ] Multiple Logical Statement A very common question to ask of vector elements is whether they fit certain criteria. You could ask if the values are equal to a certain value, or if they are less than a certain value, and so on. Keeping with the idea of performing a simultaneous operation on each element of a vector, we can do this with our vectors. = or <- #assign something to a variable, e.g. x = c( a, b, b, e ) == #ask whether two things are equal, e.g. x = c(3,5,6,3) and then x == 3 gives T F F T #Then y[x == 3] gives those entries of y where x equals 3, i.e. the 1st and 4th entry of y > x = c(3,5,6,3) > x==3 24

25 [1] TRUE FALSE FALSE TRUE The following tables gives the six fundamental logical tests than can be performed on data. x<y x>y x<=y x>=y x==y x!=y One final logical test which can be extremely helpful for extracting data is coded using the command %in% which can be thought of as is in. It is uses a very similar syntax to the test above, but looks in a second vector for any values provided in the first. x%in%y This has given a logical vector with the values based on whether each specific value of x is in the vector y.!x%in%y # we have effectively asked, which values in x are not in y. Logic Statements, and a Few Other Random but Useful Commands in R Studio > Age[1:5] > temp <-Age>15 > temp [1:5] FALSE TRUE TRUE FALSE FALSE 0 : FALSE 1: TRUE > temp2 <-as.numeric(age>15) > temp2 [1:5] Female and Smoke to use > FemSmoke <-Gender== female & smoke== yes > FemSmoke [1:5] FALSE TRUE FALSE FALSE FALSE We can add this last statement to our DataSet. > MoreData <- cbind(lungcapdata, FemSmoke) > MoreData [1:5, ] e.g. 25

26 >mean (AGE[GENDER== female ]) [1] FemData <- example[gender== female,] Summary Statistics in R Studio Mean, Standard Deviation, Frequencies, etc. > mean(lungcap) > median(lungcap) > var(lungcap) > sd(lungcap) > sqrt(lungcap) > min(lungcap) > max(lungcap) > range(lungcap) > quantile(lungcap, probs=0,90) > quantile(lungcap, probs=c(0.20,0.5,0.9,1)) > sum(lungcap) > sum(lungcap)/725 > cor(lungcap, Age) > var(lungcap, Age) ANOVA is a parametric method appropriate for comparing the means for 2 or more independent populations. Pearson s correlation is used to examine the strength of the linear relationship between the 2 numeric variables. > cor(age, Height) 0.83 # fearly strong linear association. 26

27 Plots in R Studio An incredibly useful feature of the RStudio layout is the ability to scroll through all the plots you have created in your current session. Note the back arrow on the top left corner of the Plot window. We can use this, and the corresponding forwards arrow to look through everything we have done. When combined with the Export button at the top of this window this is pretty handy. Traditionally in R we save plots using code, and this is still a useful concept, particularly if you are developing plots from publication and issues like graphics resolution may require continued tweaking. However, clicking the Export button will give you the option of saving an image as a.pdf or any number of graphic formats. Traditionally we save in.png format and you can set the final image size in this window. Scatterplots Scatterplots are appropriate for examine the relationship between 2 numeric variables. By default, R creates a scatterplot with each x, y pair indicated by an open circle. The plot itself should appear under the plots tab of the lower right panel of RStudio. Notice that the command above again looks like a function, this time with two arguments separated by a comma. The first argument in the plot function specifies the variable for the x-axis and the second for the y-axis. If we wanted to connect the data points with lines, we could add a third argument, the letter l for line. > plot(x=lungdata$age, y=lungdata$heigth, type=l) To read what a function does and learn the arguments that are available to you, just type in a question mark followed by the name of the function that you are interested in?plot Notice that the help file replaces the plot in the lower right panel. You can toggle between plots and help files using the tabs at the top of that panel. Height and Age > attach(lungdata) > plot(age, Height) Height Age 27

28 > plot(age, Height, main= Scatterplot, xlab= AGE, ylab= Height ) > plot(age, Height, main= Scatterplot, xlab= AGE, ylab= Height, las=1) > plot(age, Height, main= Scatterplot, xlab= AGE, ylab= Height, las=1, xlim=c(0,25)) > plot(age, Height, main= Scatterplot, xlab= AGE, ylab= Height, las=1, xlim=c(0,25), cex=0,5) > plot(age, Height, main= Scatterplot, xlab= AGE, ylab= Height, las=1, xlim=c(0,25), pch=8, col=2) 80 Scatterplot Height > abline(lm(height~age)) AGE > abline(lm(height~age), col=4) 80 Scatterplot Height AGE 28

29 Barchart A bar chart is a visual display of the frequency for each category of a categorical variable or the relative frequency (%) for each category. > table (Gender) Gender female male > count <-table(gender) # to use later > table (Gender)/725 # percentage > percent <-table(gender)/725 # to use later > barplot(count) > barplot(percent) > barplot(percent, main= TITLE, xlab= Gender, ylab= % ) > barplot(percent, main= TITLE, xlab = Gender, ylab= %, las=1) > barplot(percent, main= TITLE, xlab = Gender, ylab= %, las=1, names.arg=c( Female, Male )) > barplot(percent, main= TITLE, xlab = Gender, ylab= %, las=1, names.arg=c( Female, Male ), horiz=true) TITLE Male % Female Gender 29

30 female male > pie(count) > pie(count, main= TITLE here ) Box Plots A boxplot is appropriate for summarizing the distribution of a numeric variable. It may be useful to compare all of the libraries visually using a boxplot. > boxplot(lungcap) > boxplot(lungcap, main= Boxplot, ylab= Lung Capacity ) > boxplot(lungcap, main= Boxplot, ylab= Lung Capacity, ylim=c(0,16)) > boxplot(lungcap, main= Boxplot, ylab= Lung Capacity, ylim=c(0,16), las=1) Boxplot 15 Lung Capacity > boxplot(lungcap ~ Gender) 30

31 > boxplot(lungcap ~ Gender, main= Boxplot by Gender ) Boxplot by Gender female male > boxplot(lungcap[gender== female ], LungCap[Gender== male ]) > quantile (LungCap, probs=c(0,0.25,0.5,0.75,1)) Histogram in R Studio A histogram is appropriate for summarizing the distribution of a numeric variable. R has default histogram() function. > hist(lungcap) > hist(lungcap, freq=false) > hist(lungcap, prob=t) > hist(lungcap, freq=false, ylim=c(0,0.2)) > hist(lungcap, freq=false, ylim=c(0,0.2), breaks=7) > hist(lungcap, freq=false, ylim=c(0,0.2), breaks=14) > hist(lungcap, freq=false, ylim=c(0,0.2), breaks=c(0,2,4,6,8,10,12,14,16)) > hist(lungcap, freq=false, ylim=c(0,0.2), breaks=seq(from=0, to=16, by=2)) > hist(lungcap, freq=false, ylim=c(0,0.2), breaks=14, main= Boxplot of Lung Capacity, xlab= Lung Capacity ) > hist(lungcap, freq=false, ylim=c(0,0.2), breaks=14, main= Boxplot of Lung Capacity, xlab= Lung Capacity, las=1) 31

32 Boxplot of Lung Capacity Density Lung Capacity > lines(density(lungcap)) > lines(density(lungcap), col=2, lwd=3) Boxplot of Lung Capacity Density Lung Capacity 32

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

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

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

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

Statistical Software Camp: Introduction to R

Statistical Software Camp: Introduction to R Statistical Software Camp: Introduction to R Day 1 August 24, 2009 1 Introduction 1.1 Why Use R? ˆ Widely-used (ever-increasingly so in political science) ˆ Free ˆ Power and flexibility ˆ Graphical capabilities

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 for IR. Created by Narren Brown, Grinnell College, and Diane Saphire, Trinity University

R for IR. Created by Narren Brown, Grinnell College, and Diane Saphire, Trinity University R for IR Created by Narren Brown, Grinnell College, and Diane Saphire, Trinity University For presentation at the June 2013 Meeting of the Higher Education Data Sharing Consortium Table of Contents I.

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

Example how not to do it: JMP in a nutshell 1 HR, 17 Apr Subject Gender Condition Turn Reactiontime. A1 male filler

Example how not to do it: JMP in a nutshell 1 HR, 17 Apr Subject Gender Condition Turn Reactiontime. A1 male filler JMP in a nutshell 1 HR, 17 Apr 2018 The software JMP Pro 14 is installed on the Macs of the Phonetics Institute. Private versions can be bought from

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

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

Chapter 6: DESCRIPTIVE STATISTICS

Chapter 6: DESCRIPTIVE STATISTICS Chapter 6: DESCRIPTIVE STATISTICS Random Sampling Numerical Summaries Stem-n-Leaf plots Histograms, and Box plots Time Sequence Plots Normal Probability Plots Sections 6-1 to 6-5, and 6-7 Random Sampling

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

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

Tutorial: SeqAPass Boxplot Generator

Tutorial: SeqAPass Boxplot Generator 1 Tutorial: SeqAPass Boxplot Generator 1. Access SeqAPASS by opening https://seqapass.epa.gov/seqapass/ using Mozilla Firefox web browser 2. Open the About link on the login page or upon logging in to

More information

Opening a Data File in SPSS. Defining Variables in SPSS

Opening a Data File in SPSS. Defining Variables in SPSS Opening a Data File in SPSS To open an existing SPSS file: 1. Click File Open Data. Go to the appropriate directory and find the name of the appropriate file. SPSS defaults to opening SPSS data files with

More information

7/18/16. Review. Review of Homework. Lecture 3: Programming Statistics in R. Questions from last lecture? Problems with Stata? Problems with Excel?

7/18/16. Review. Review of Homework. Lecture 3: Programming Statistics in R. Questions from last lecture? Problems with Stata? Problems with Excel? Lecture 3: Programming Statistics in R Christopher S. Hollenbeak, PhD Jane R. Schubart, PhD The Outcomes Research Toolbox Review Questions from last lecture? Problems with Stata? Problems with Excel? 2

More information

An Introductory Guide to R

An Introductory Guide to R An Introductory Guide to R By Claudia Mahler 1 Contents Installing and Operating R 2 Basics 4 Importing Data 5 Types of Data 6 Basic Operations 8 Selecting and Specifying Data 9 Matrices 11 Simple Statistics

More information

Introduction to Minitab 1

Introduction to Minitab 1 Introduction to Minitab 1 We begin by first starting Minitab. You may choose to either 1. click on the Minitab icon in the corner of your screen 2. go to the lower left and hit Start, then from All Programs,

More information

Chapter 2 Assignment (due Thursday, April 19)

Chapter 2 Assignment (due Thursday, April 19) (due Thursday, April 19) Introduction: The purpose of this assignment is to analyze data sets by creating histograms and scatterplots. You will use the STATDISK program for both. Therefore, you should

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

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Introduction This handout briefly outlines most of the basic uses and functions of Excel that we will be using in this course. Although Excel may be used for performing statistical

More information

Coding & Data Skills for Communicators Dr. Cindy Royal Texas State University - San Marcos School of Journalism and Mass Communication

Coding & Data Skills for Communicators Dr. Cindy Royal Texas State University - San Marcos School of Journalism and Mass Communication Coding & Data Skills for Communicators Dr. Cindy Royal Texas State University - San Marcos School of Journalism and Mass Communication Spreadsheet Basics Excel is a powerful productivity tool. It s a spreadsheet

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

Correlation. January 12, 2019

Correlation. January 12, 2019 Correlation January 12, 2019 Contents Correlations The Scattterplot The Pearson correlation The computational raw-score formula Survey data Fun facts about r Sensitivity to outliers Spearman rank-order

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

MS Office for Engineers

MS Office for Engineers MS Office for Engineers Lesson 4 Excel 2 Pre-reqs/Technical Skills Basic knowledge of Excel Completion of Excel 1 tutorial Basic computer use Expectations Read lesson material Implement steps in software

More information

This document is designed to get you started with using R

This document is designed to get you started with using R An Introduction to R This document is designed to get you started with using R We will learn about what R is and its advantages over other statistics packages the basics of R plotting data and graphs What

More information

Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9

Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9 Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9 Contents 1 Introduction to Using Excel Spreadsheets 2 1.1 A Serious Note About Data Security.................................... 2 1.2

More information

Lab 1. Introduction to R & SAS. R is free, open-source software. Get it here:

Lab 1. Introduction to R & SAS. R is free, open-source software. Get it here: Lab 1. Introduction to R & SAS R is free, open-source software. Get it here: http://tinyurl.com/yfet8mj for your own computer. 1.1. Using R like a calculator Open R and type these commands into the R Console

More information

Assignment 0. Nothing here to hand in

Assignment 0. Nothing here to hand in Assignment 0 Nothing here to hand in The questions here have solutions attached. Follow the solutions to see what to do, if you cannot otherwise guess. Though there is nothing here to hand in, it is very

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

University of Wollongong School of Mathematics and Applied Statistics. STAT231 Probability and Random Variables Introductory Laboratory

University of Wollongong School of Mathematics and Applied Statistics. STAT231 Probability and Random Variables Introductory Laboratory 1 R and RStudio University of Wollongong School of Mathematics and Applied Statistics STAT231 Probability and Random Variables 2014 Introductory Laboratory RStudio is a powerful statistical analysis package.

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

Stata: A Brief Introduction Biostatistics

Stata: A Brief Introduction Biostatistics Stata: A Brief Introduction Biostatistics 140.621 2005-2006 1. Statistical Packages There are many statistical packages (Stata, SPSS, SAS, Splus, etc.) Statistical packages can be used for Analysis Data

More information

IN-CLASS EXERCISE: INTRODUCTION TO R

IN-CLASS EXERCISE: INTRODUCTION TO R NAVAL POSTGRADUATE SCHOOL IN-CLASS EXERCISE: INTRODUCTION TO R Survey Research Methods Short Course Marine Corps Combat Development Command Quantico, Virginia May 2013 In-class Exercise: Introduction to

More information

A Brief Introduction to R

A Brief Introduction to R A Brief Introduction to R Babak Shahbaba Department of Statistics, University of California, Irvine, USA Chapter 1 Introduction to R 1.1 Installing R To install R, follow these steps: 1. Go to http://www.r-project.org/.

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

LAB 1 INSTRUCTIONS DESCRIBING AND DISPLAYING DATA

LAB 1 INSTRUCTIONS DESCRIBING AND DISPLAYING DATA LAB 1 INSTRUCTIONS DESCRIBING AND DISPLAYING DATA This lab will assist you in learning how to summarize and display categorical and quantitative data in StatCrunch. In particular, you will learn how to

More information

Introduction to R (BaRC Hot Topics)

Introduction to R (BaRC Hot Topics) Introduction to R (BaRC Hot Topics) George Bell September 30, 2011 This document accompanies the slides from BaRC s Introduction to R and shows the use of some simple commands. See the accompanying slides

More information

You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables

You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables Jennie Murack You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables How to conduct basic descriptive statistics

More information

International Graduate School of Genetic and Molecular Epidemiology (GAME) Computing Notes and Introduction to Stata

International Graduate School of Genetic and Molecular Epidemiology (GAME) Computing Notes and Introduction to Stata International Graduate School of Genetic and Molecular Epidemiology (GAME) Computing Notes and Introduction to Stata Paul Dickman September 2003 1 A brief introduction to Stata Starting the Stata program

More information

Statistics with a Hemacytometer

Statistics with a Hemacytometer Statistics with a Hemacytometer Overview This exercise incorporates several different statistical analyses. Data gathered from cell counts with a hemacytometer is used to explore frequency distributions

More information

Entering and Outputting Data 2 nd best TA ever: Steele H. Valenzuela February 2-6, 2015

Entering and Outputting Data 2 nd best TA ever: Steele H. Valenzuela February 2-6, 2015 Entering and Outputting Data 2 nd best TA ever: Steele H. Valenzuela February 2-6, 2015 Contents Things to Know Before You Begin.................................... 1 Entering and Outputting Data......................................

More information

Quick Start Guide Jacob Stolk PhD Simone Stolk MPH November 2018

Quick Start Guide Jacob Stolk PhD Simone Stolk MPH November 2018 Quick Start Guide Jacob Stolk PhD Simone Stolk MPH November 2018 Contents Introduction... 1 Start DIONE... 2 Load Data... 3 Missing Values... 5 Explore Data... 6 One Variable... 6 Two Variables... 7 All

More information

CHAPTER 4: MICROSOFT OFFICE: EXCEL 2010

CHAPTER 4: MICROSOFT OFFICE: EXCEL 2010 CHAPTER 4: MICROSOFT OFFICE: EXCEL 2010 Quick Summary A workbook an Excel document that stores data contains one or more pages called a worksheet. A worksheet or spreadsheet is stored in a workbook, and

More information

Week 1: Introduction to R, part 1

Week 1: Introduction to R, part 1 Week 1: Introduction to R, part 1 Goals Learning how to start with R and RStudio Use the command line Use functions in R Learning the Tools What is R? What is RStudio? Getting started R is a computer program

More information

Computer lab 2 Course: Introduction to R for Biologists

Computer lab 2 Course: Introduction to R for Biologists Computer lab 2 Course: Introduction to R for Biologists April 23, 2012 1 Scripting As you have seen, you often want to run a sequence of commands several times, perhaps with small changes. An efficient

More information

R in Linguistic Analysis. Week 2 Wassink Autumn 2012

R in Linguistic Analysis. Week 2 Wassink Autumn 2012 R in Linguistic Analysis Week 2 Wassink Autumn 2012 Today R fundamentals The anatomy of an R help file but first... How did you go about learning the R functions in the reading? More help learning functions

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

Install RStudio from - use the standard installation.

Install RStudio from   - use the standard installation. Session 1: Reading in Data Before you begin: Install RStudio from http://www.rstudio.com/ide/download/ - use the standard installation. Go to the course website; http://faculty.washington.edu/kenrice/rintro/

More information

Homework 1 Excel Basics

Homework 1 Excel Basics Homework 1 Excel Basics Excel is a software program that is used to organize information, perform calculations, and create visual displays of the information. When you start up Excel, you will see the

More information

History, installation and connection

History, installation and connection History, installation and connection The men behind our software Jim Goodnight, CEO SAS Inc Ross Ihaka Robert Gentleman (Duncan Temple Lang) originators of R 2 / 75 History SAS From late 1960s, North Carolina

More information

1 Introduction to Using Excel Spreadsheets

1 Introduction to Using Excel Spreadsheets Survey of Math: Excel Spreadsheet Guide (for Excel 2007) Page 1 of 6 1 Introduction to Using Excel Spreadsheets This section of the guide is based on the file (a faux grade sheet created for messing with)

More information

Data can be in the form of numbers, words, measurements, observations or even just descriptions of things.

Data can be in the form of numbers, words, measurements, observations or even just descriptions of things. + What is Data? Data is a collection of facts. Data can be in the form of numbers, words, measurements, observations or even just descriptions of things. In most cases, data needs to be interpreted and

More information

1. Basic Steps for Data Analysis Data Editor. 2.4.To create a new SPSS file

1. Basic Steps for Data Analysis Data Editor. 2.4.To create a new SPSS file 1 SPSS Guide 2009 Content 1. Basic Steps for Data Analysis. 3 2. Data Editor. 2.4.To create a new SPSS file 3 4 3. Data Analysis/ Frequencies. 5 4. Recoding the variable into classes.. 5 5. Data Analysis/

More information

An Introductory Tutorial: Learning R for Quantitative Thinking in the Life Sciences. Scott C Merrill. September 5 th, 2012

An Introductory Tutorial: Learning R for Quantitative Thinking in the Life Sciences. Scott C Merrill. September 5 th, 2012 An Introductory Tutorial: Learning R for Quantitative Thinking in the Life Sciences Scott C Merrill September 5 th, 2012 Chapter 2 Additional help tools Last week you asked about getting help on packages.

More information

Chapter One: Getting Started With IBM SPSS for Windows

Chapter One: Getting Started With IBM SPSS for Windows Chapter One: Getting Started With IBM SPSS for Windows Using Windows The Windows start-up screen should look something like Figure 1-1. Several standard desktop icons will always appear on start up. Note

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 2015 Bioinformatics and Research Computing Whitehead Institute http://barc.wi.mit.edu/hot_topics/

More information

Exploring and Understanding Data Using R.

Exploring and Understanding Data Using R. Exploring and Understanding Data Using R. Loading the data into an R data frame: variable

More information

SISG/SISMID Module 3

SISG/SISMID Module 3 SISG/SISMID Module 3 Introduction to R Ken Rice Tim Thornton University of Washington Seattle, July 2018 Introduction: Course Aims This is a first course in R. We aim to cover; Reading in, summarizing

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

GRETL FOR TODDLERS!! CONTENTS. 1. Access to the econometric software A new data set: An existent data set: 3

GRETL FOR TODDLERS!! CONTENTS. 1. Access to the econometric software A new data set: An existent data set: 3 GRETL FOR TODDLERS!! JAVIER FERNÁNDEZ-MACHO CONTENTS 1. Access to the econometric software 3 2. Loading and saving data: the File menu 3 2.1. A new data set: 3 2.2. An existent data set: 3 2.3. Importing

More information

Reading data in SAS and Descriptive Statistics

Reading data in SAS and Descriptive Statistics P8130 Recitation 1: Reading data in SAS and Descriptive Statistics Zilan Chai Sep. 18 th /20 th 2017 Outline Intro to SAS (windows, basic rules) Getting Data into SAS Descriptive Statistics SAS Windows

More information

Ph3 Mathematica Homework: Week 1

Ph3 Mathematica Homework: Week 1 Ph3 Mathematica Homework: Week 1 Eric D. Black California Institute of Technology v1.1 1 Obtaining, installing, and starting Mathematica Exercise 1: If you don t already have Mathematica, download it and

More information

Quick introduction to descriptive statistics and graphs in. R Commander. Written by: Robin Beaumont

Quick introduction to descriptive statistics and graphs in. R Commander. Written by: Robin Beaumont Quick introduction to descriptive statistics and graphs in R Commander Written by: Robin Beaumont e-mail: robin@organplayers.co.uk http://www.robin-beaumont.co.uk/virtualclassroom/stats/course1.html Date

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

CHAPTER 6. The Normal Probability Distribution

CHAPTER 6. The Normal Probability Distribution The Normal Probability Distribution CHAPTER 6 The normal probability distribution is the most widely used distribution in statistics as many statistical procedures are built around it. The central limit

More information

R for large data and bioinformatics

R for large data and bioinformatics R for large data and bioinformatics Thomas Lumley Ken Rice Universities of Washington and Auckland Auckland, November 2013 Introduction: Course Aims Under the hood of R R essentials, and programming skills

More information

8.3 Come analizzare i dati: introduzione a RStudio

8.3 Come analizzare i dati: introduzione a RStudio 8.3 Come analizzare i dati: introduzione a RStudio Insegnamento di Informatica Elisabetta Ronchieri Corso di Laurea di Economia, Universitá di Ferrara I semestre, anno 2014-2015 Elisabetta Ronchieri (Universitá)

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

Statistics 13, Lab 1. Getting Started. The Mac. Launching RStudio and loading data

Statistics 13, Lab 1. Getting Started. The Mac. Launching RStudio and loading data Statistics 13, Lab 1 Getting Started This first lab session is nothing more than an introduction: We will help you navigate the Statistics Department s (all Mac) computing facility and we will get you

More information

A Short Guide to R with RStudio

A Short Guide to R with RStudio Short Guides to Microeconometrics Fall 2013 Prof. Dr. Kurt Schmidheiny Universität Basel A Short Guide to R with RStudio 2 1 Introduction A Short Guide to R with RStudio 1 Introduction 3 2 Installing R

More information

STAT:5400 Computing in Statistics

STAT:5400 Computing in Statistics STAT:5400 Computing in Statistics Introduction to SAS Lecture 18 Oct 12, 2015 Kate Cowles 374 SH, 335-0727 kate-cowles@uiowaedu SAS SAS is the statistical software package most commonly used in business,

More information

Applied Regression Modeling: A Business Approach

Applied Regression Modeling: A Business Approach i Applied Regression Modeling: A Business Approach Computer software help: SAS SAS (originally Statistical Analysis Software ) is a commercial statistical software package based on a powerful programming

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

STATISTICAL TECHNIQUES. Interpreting Basic Statistical Values

STATISTICAL TECHNIQUES. Interpreting Basic Statistical Values STATISTICAL TECHNIQUES Interpreting Basic Statistical Values INTERPRETING BASIC STATISTICAL VALUES Sample representative How would one represent the average or typical piece of information from a given

More information

Frequency Distributions and Descriptive Statistics in SPS

Frequency Distributions and Descriptive Statistics in SPS 230 Combs Building 859.622.3050 studentcomputing.eku.edu studentcomputing@eku.edu Frequency Distributions and Descriptive Statistics in SPSS In this tutorial, we re going to work through a sample problem

More information

Brief Guide on Using SPSS 10.0

Brief Guide on Using SPSS 10.0 Brief Guide on Using SPSS 10.0 (Use student data, 22 cases, studentp.dat in Dr. Chang s Data Directory Page) (Page address: http://www.cis.ysu.edu/~chang/stat/) I. Processing File and Data To open a new

More information

2015 Vanderbilt University

2015 Vanderbilt University Excel Supplement 2015 Vanderbilt University Introduction This guide describes how to perform some basic data manipulation tasks in Microsoft Excel. Excel is spreadsheet software that is used to store information

More information

2. Getting started with MLwiN

2. Getting started with MLwiN 2. Getting started with MLwiN Introduction This chapter aims to provide you with some practice with MLwiN commands before you begin to fit multilevel models. It is may be helpful if you have already read

More information

Introduction to the workbook and spreadsheet

Introduction to the workbook and spreadsheet Excel Tutorial To make the most of this tutorial I suggest you follow through it while sitting in front of a computer with Microsoft Excel running. This will allow you to try things out as you follow along.

More information

Business Statistics: R tutorials

Business Statistics: R tutorials Business Statistics: R tutorials Jingyu He September 29, 2017 Install R and RStudio R is a free software environment for statistical computing and graphics. Download free R and RStudio for Windows/Mac:

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

Statistical Package for the Social Sciences INTRODUCTION TO SPSS SPSS for Windows Version 16.0: Its first version in 1968 In 1975.

Statistical Package for the Social Sciences INTRODUCTION TO SPSS SPSS for Windows Version 16.0: Its first version in 1968 In 1975. Statistical Package for the Social Sciences INTRODUCTION TO SPSS SPSS for Windows Version 16.0: Its first version in 1968 In 1975. SPSS Statistics were designed INTRODUCTION TO SPSS Objective About the

More information

For many people, learning any new computer software can be an anxietyproducing

For many people, learning any new computer software can be an anxietyproducing 1 Getting to Know Stata 12 For many people, learning any new computer software can be an anxietyproducing task. When that computer program involves statistics, the stress level generally increases exponentially.

More information

BIOSTATISTICS LABORATORY PART 1: INTRODUCTION TO DATA ANALYIS WITH STATA: EXPLORING AND SUMMARIZING DATA

BIOSTATISTICS LABORATORY PART 1: INTRODUCTION TO DATA ANALYIS WITH STATA: EXPLORING AND SUMMARIZING DATA BIOSTATISTICS LABORATORY PART 1: INTRODUCTION TO DATA ANALYIS WITH STATA: EXPLORING AND SUMMARIZING DATA Learning objectives: Getting data ready for analysis: 1) Learn several methods of exploring the

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

ECO375 Tutorial 1 Introduction to Stata

ECO375 Tutorial 1 Introduction to Stata ECO375 Tutorial 1 Introduction to Stata Matt Tudball University of Toronto Mississauga September 14, 2017 Matt Tudball (University of Toronto) ECO375H5 September 14, 2017 1 / 25 What Is Stata? Stata is

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

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

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

Gradebook Export/Import Instructions

Gradebook Export/Import Instructions Gradebook Export/Import Instructions Introduction Canvas gives the option to export the gradebook to a CSV file. You can open this file in a spreadsheet program and add or change grades, add columns and

More information

STAT 20060: Statistics for Engineers. Statistical Programming with R

STAT 20060: Statistics for Engineers. Statistical Programming with R STAT 20060: Statistics for Engineers Statistical Programming with R Why R? Because it s free to download for everyone! Most statistical software is very, very expensive, so this is a big advantage. Statisticians

More information

Depending on the computer you find yourself in front of, here s what you ll need to do to open SPSS.

Depending on the computer you find yourself in front of, here s what you ll need to do to open SPSS. 1 SPSS 11.5 for Windows Introductory Assignment Material covered: Opening an existing SPSS data file, creating new data files, generating frequency distributions and descriptive statistics, obtaining printouts

More information

AcaStat User Manual. Version 8.3 for Mac and Windows. Copyright 2014, AcaStat Software. All rights Reserved.

AcaStat User Manual. Version 8.3 for Mac and Windows. Copyright 2014, AcaStat Software. All rights Reserved. AcaStat User Manual Version 8.3 for Mac and Windows Copyright 2014, AcaStat Software. All rights Reserved. http://www.acastat.com Table of Contents INTRODUCTION... 5 GETTING HELP... 5 INSTALLATION... 5

More information

MAT 142 College Mathematics. Module ST. Statistics. Terri Miller revised July 14, 2015

MAT 142 College Mathematics. Module ST. Statistics. Terri Miller revised July 14, 2015 MAT 142 College Mathematics Statistics Module ST Terri Miller revised July 14, 2015 2 Statistics Data Organization and Visualization Basic Terms. A population is the set of all objects under study, a sample

More information

Research Methods for Business and Management. Session 8a- Analyzing Quantitative Data- using SPSS 16 Andre Samuel

Research Methods for Business and Management. Session 8a- Analyzing Quantitative Data- using SPSS 16 Andre Samuel Research Methods for Business and Management Session 8a- Analyzing Quantitative Data- using SPSS 16 Andre Samuel A Simple Example- Gym Purpose of Questionnaire- to determine the participants involvement

More information

Lab #1: Introduction to Basic SAS Operations

Lab #1: Introduction to Basic SAS Operations Lab #1: Introduction to Basic SAS Operations Getting Started: OVERVIEW OF SAS (access lab pages at http://www.stat.lsu.edu/exstlab/) There are several ways to open the SAS program. You may have a SAS icon

More information

Excel Tips and FAQs - MS 2010

Excel Tips and FAQs - MS 2010 BIOL 211D Excel Tips and FAQs - MS 2010 Remember to save frequently! Part I. Managing and Summarizing Data NOTE IN EXCEL 2010, THERE ARE A NUMBER OF WAYS TO DO THE CORRECT THING! FAQ1: How do I sort my

More information