- Helper functions
- Tutorials: Basic Topics
- Tutorials: Advanced
- Visual walk-throughs
- Flow Charts
- Worked examples from Biological Data Analysis, 2nd ed
R helper functions
Simple functions and wrappers to help students with basic R tasks.
binom.CI(): Calculates Wilson’s (1927) confidence interval for a binomial proportion.
plot.means(): Makes basic, annotated plots of means w/ approximate 95% confidence intervals from user-supplied standard errors or confidence intervals
plotTukeysHSD(): makes basic, annotated plot of output of R’s TukeyHSD function (but prettier, IMHO)
R Tutorials: Basic Topics
Code demonstrating basic R tasks.
Loading (messy) data into R: Outline for some tricks to get your data into R.
Plotting means w/ errbar(): making plots with the errbar() function in the Hmisc package
Creating factors/categorical variables: one of the most annoying things in R…
Paired t-test walk through (sorry, data not provided).
Paired t-tests: 2 equivalent ways. two ways to do a paired t-test w/ different syntax or data formatting.
Basic R analysis tasks: General walk through of math, summary(), and basic plots.
Standard error for the difference between 2 means: functions for pooled variance and SE of difference, for calculating t-statistics
R Tutorials: More Advanced
Reshaping data: outline of notes on basic data re-shaping
General R Tasks:
Doing Stats in R:
Introduction to ANOVA Part 1 (Lab 9): Summary statistics.
Double-sided summaries of important R tasks, functions, and output
Slides demonstrating basic R tasks.
From CalU of PA ENS 495: Design & Analysis, Fall 2016
Lab 1: Intro to R. Intro to R, plotting eagle populations, etc
Lab 2a: Displaying Data: boxplot() and hist()
Lab 2b: Displaying Data: plotting means
Lab 3a: Basic math for stats in R: mean, variance, standard deviation, standard error
Lab 4: Working with grouped data: using subset() and tapply(), plotting group means, etc
Lab 7: t-tests. 1-sample, 2-sample, paired
Lab 9b: data. Deer antler datasets for 1-way ANVOA
Lab 11a: More regression: Linear regression
Lab 11b: More regression: logistic regression
Lab 11c: More regression: multiple regression
Lab 12: Regression Diagnostics. qqplots, leverage and Cook’s distance, etc.
Sample content in RPubs of final paper: Sample content for a complete term paper
Code for Lectures:
Final Lecture a: Reporting results of 1-way ANOVA for independent project
Final Lecture b: 2-way ANOVA
How R works with strings of numbers: or always put numbers in “c(…)”!
Whitlock & Shulter’s Biological Data Analysis
Worked examples from Analysis of Biological Data, 2nd ed.
Chapter 12: Question 18 2 sample t-test example
Chapter 12: Question 20 Paired t-test example