UMBC Training Centers logo

R Programming

 

Course Description | Outline

Day 1: Introduction to R and basic statistical methods using R commander

1. Overview of the system
(a) Getting set up: Installing R, starting R, working directory, writing scripts
(b) Accessing help files
(c) R and S-plus
(d) R packages
(e) A sample session

2. R Commander
(a) Overview of the basic features: The interface, working with data and models.
(b) Probability distributions: Generating data using R commander
(c) Reading data using R commander (text file and Excel)
(d) Graphs in R commander (list of the graphs available and some examples - his-
togram, boxplot, qq plot)
(e) Summary statistics in R commander (list of summary statistics that are available
and some examples)
(f) Some basic statistical methods with examples
i. Confidence intervals and hypothesis tests for the mean
ii. One-way analysis of variance
iii. Linear regression
iv. Contingency table analysis
v. Nonparametric methods

3. Importing SAS data into R

4. Managing projects, saving data and source code
(a) Saving the workspace: .RData files, save() and save.image()
(b) Writing data to a file: write.table()
(c) Saving source code

5. Using high-level plotting functions

6. Enhancing and customizing plots
(a) Adding points or lines to a plot
(b) Adding a legend
(c) Adjusting the size of a plot for inclusion in a document
(d) Including mathematical annotation on a plot

Day 2: Basic elements of R programming and statistical methods

1. Arrays and matrices
(a) Creating matrices and arrays: array() and matrix()
(b) Indexing
(c) Matrix facilities: multiplication, solving linear equations, inversion, etc.

2. Lists and data frames
(a) Construction, modification, and concatenation of lists
(b) Data frame as a special form of a list
(c) Overview of data structures important for understanding data frames: vectors
(numeric, character, or logical), factors, numeric matrices
(d) Construction of data frames: data.frame()
(e) Working with data frames: Accessing, modifying, subsetting, merging, matching,
summarizing, etc.
(f) Writing your own functions

3. Tinn-R: An integrated development environment (IDE) for R

4. Running simulations
(a) Basic programming elements for running simulation: random number generator,
arrays, loops, etc.
(b) Examples: Central Limit Theorem illustration, comparing estimators, computing
confidence level

5. Sample size calculations and plotting power functions

6. Jackknife and bootstrap: overview and examples

Day 3: Additional topics in R programming and statistical methods

1. Writing efficient code

2. Timing

3. Debugging programs

4. Parallel processing

5. Working with large data sets

6. Interacting with a database: RSQLite

7. Building and distributing packages

8. Some additional statistical methods
(a) Generalized linear models
(b) Mixed-effects models
(c) Meta-analysis
(d) Nonlinear regression
(e) Nonparametric regression