######## # Lecture 1 # Example data # Andrew Jaffe ############ # Here's a basic two by two matrix # note that I'm filling it in by rows, # so that [1,2] is row 1 and [3,4] is on row 2 mat <- matrix(c(1,2,3,4), nrow = 2, ncol = 2, byrow = T) set.seed(1) # so this data is always generated to be the same # this is important for reproducibility # you can pick your favorite number! # Here's a dataframe of 3 variables # 2 columns of binary data, and a column of continuous dat <- data.frame(cbind(sample(c("M","F"),100,replace=T), sample(c(0,1),100,replace=T), round(rnorm(100, mean = 70, sd = 2),2))) names(dat) <- c("sex","status","height")