A hands-on tutorial on using R for (mostly) linguistics research

ÇağÇöltekin

04-04-2013, 22:57

Warning: This document is work in progress. You should visit later for a more complete and correct version. The latest version can be found at http://www.let.rug.nl/coltekin/R/. Any suggestions and/or corrections are welcome.

This document is a hands-on tutorial on R, a powerful statistical analysis software. The tutorial is prepared for the course Seminar in Methodology and Statistics course taught by John Nerbonne in University of Groningen.

The aim of the exercises is to provide a hands-on tutorial on some statistical analysis procedures that are common in various branches of linguistics. This tutorial assumes that you are familiar with basic statistical concepts. However, no initial knowledge of R is assumed.

HTML version of this tutorial makes use of MathML. Too see the mathematical formulas correctly you should use a MathML capable browser. Recent versions of Firefox works out of the box, for other browsers you may need additional plugins. Alternatively, you can download and use the PDF version of the complete exercise set. PDF version is also useful if you prefer to have a printed version of the exercises.

1 Starting R and finding your way around
 Exercises
2 Simple calculations and variable assignment
 2.1 Using R as a calculator
 2.2 Variables
 Exercises
3 Vectors in R
 Exercises
4 Comparing two means
 4.1 One-sample T-test
 4.2 Independent-samples T-test
 4.3 Paired t-test
5 Basic graphs in R
 Exercises
6 Simple data exploration and statistical tests
 6.1 Graphical data exploration
 6.2 Testing for normality
7 Non-parametric tests for comparing means
8 Probability Distributions
 Exercises
9 Data frames
 9.1 Creating a data frame on R command line
 9.2 Importing data
 9.3 Accessing elements of a data frame
10 Correlation
 Exercises
11 Linear regression for single explanatory variable
 11.1 Diagnostics
 11.2 Predictions of a linear model
 Exercises
12 Advanced data manipulation
 12.1 R data types
 12.2 Missing values
 12.3 Factor variables
 12.4 Accessing elements of a vector or a data frame
 12.5 Some common operations on data frames
 12.6 Adding and removing rows and columns from a data frame
 Exercises
13 One-way ANOVA
14 Multiple regression
 14.1 Data preparation
 14.2 A refresher on regression
 14.3 Multiple regression
 14.4 Model selection
15 More on graphs
 15.1 Labels, axes, legends …
 15.2 More than one graph on the same canvas
 15.3 Writing your graphs to external files
 Exercises
A Answers
B Resources
 B.1 TODO
C Model formulas