Module 3
Key topics
- Principles of experimental design
- Multiple comparisons
- Sums of Squares
- Mixed/random effects
We now know how to deal with data in R
; however, before we start drawing conclusions we need to know how the data were collected and more importantly. perhaps, collect data ourselves. Generally, data is either observational (data collected where researchers don’t control the environment, but simply observe outcomes) or experimental (data collected where researchers introduce some intervention and control the environment in order to draw inference).
TASK R. A. Fisher’s work in the area of experimental design is, perhaps, the most well known in the field. The principles he devised we still abide by today. Note, however, to give a balanced view of the celebrated mathematician many of his views (on eugenics and race in particular) are detested by many. I would urge you to read up on his work in this area and come to your own conclusions.
R
packages and datasets
It is assumed in all following examples of this module that the following code has been executed successfully.
packages used in this module
library(tidyverse) ## general functionality
library(edibble) ## experiment setup
library(gglm) ## nice lm() diagnostic plots
library(emmeans) ## pairwise contrasts
library(lme4) ## mixed effects models
library(lmerTest) ## mixed effects models
library(predictmeans) ## pairwise comparisons
datasets used in this module
rats
rats <- read_csv(paste(base_url, "crd_rats_data.csv", sep = ""))
rats$Surgery <- as_factor(rats$Surgery)
factorial
rcbd
split_plot
liver