Publications by Claire Morrison

NFL within sibship analysis

15.02.2023

data taken from Pro Football Focus https://www.pff.com/ manually entered speed, draft selection, PFF grade from last season played (if current, current year), age at PFF grade (e.g if currently in league, age = current age), PFF grade 3 years post draft year there were some caveats such as Peyton Manning does not have a PFF grade from 3 years out (...

8714 sym Python (5563 sym/22 pcs) 22 img 3 tbl

group and marginal means

01.02.2023

group means vs marginal means library(data.table) library(dplyr) library(forcats) library(ggplot2) source("/Users/claire/Desktop/Desktop/gradstats2022/gradstats_funcs.R") nursery<- fread("/Users/claire/Desktop/Desktop/gradstats2022/nursery.csv", header = T, data.table = F) when we have equal Ns, group means will equal the mean of means, as we’v...

5262 sym R (12733 sym/40 pcs) 1 img

plotting means

18.01.2023

plotting means is really easy! first, let’s look at some data: golf<- fread("/Users/claire/Desktop/ASA All PGA Raw Data - Tourn Level.csv", header=T, data.table=F) head(golf) ## Player_initial_last tournament id player id hole_par strokes hole_DKP ## 1 A. Hadwin 401353275 5548 284 283 57.0 ## 2 A. No...

2015 sym 3 img

rmarkdown tutorial

07.09.2022

knitr::opts_chunk$set(echo = TRUE) library(car) ## Loading required package: carData library(psych) ## ## Attaching package: 'psych' ## The following object is masked from 'package:car': ## ## logit welcome to r markdown! there is a good chance this will be a pain to learn now and might take a while to get the hang of, but it’s a useful ...

3007 sym R (2813 sym/18 pcs)

lab 4 simple model comparison

14.09.2022

very basic model comparison example create data/dataframe set.seed(5) # createa a vector of the means that we want our variables to have mu<-c(110, 36, 212) # create a vector of the standard deviations that we want our variables to have stddev <- c(15, 2, 40) # create a matrix that has the correlations we want our variables to have corMat <- ...

4677 sym 3 img

Lab 5- confidence intervals

22.09.2022

fun R code of the week! ways to look at data (hist, range, summary, str) subset using the data= function in lm() usnews<- read.csv("/Users/clairemorrison/Desktop/gradstats2022/usnews.csv", header=T, na.strings = ".") ### remember, this dataset uses "."s to denote missing data so I'm going to convert them to NAs with na.strings="." head(usnews)...

1494 sym Python (14956 sym/39 pcs) 1 img

exam 1 review

06.10.2022

review before exam 1 testing a simple model 1. question do our cars have a different mpg than 17? Model c: \(MPG_i=17+\epsilon_i\) Model a: \(MPG_i=\beta_0+\epsilon_i\) PA-PC: 1 N-PA: 31 Null: \(\beta_0 = 17\) 2. code models head(mtcars) ## mpg cyl disp hp drat wt qsec vs am gear carb ## Mazda RX4 21.0 6 160 11...

5088 sym Python (13788 sym/67 pcs)

recoding categorical variables

20.10.2022

helpful R code we often want to recode variables for specific analyses, and there are multiple ways we can do this. first, let’s just mean center, or subtract some constant from a variable already in our dataset. apgar$gestat_mean<- apgar$GESTAT-mean(apgar$GESTAT) # this is saying from our apgar dataset, create a new variable called gestat_mean...

4986 sym R (7691 sym/43 pcs) 2 img

lab 10- tolerance and multiple regression

27.10.2022

designing a study x <- matrix(rep(0,1,25), nrow = 5, dimnames = list(c("O", "X","Y","Z", "A"), c("D","A","B","C", "E"))) colnames(x)<- c("wellbeing", "int", "ext", "age", "mathability") row.names(x)<- c("wellbeing", "int", "ext", "age", "mathability") traits<-c("wellbeing", "int", "ext", "age", "mathability") # let's think about these variable...

4313 sym

interaction example

17.11.2022

Here is an example looking at the effects of illiteracy and murder rates on income. states <- as.data.frame(state.x77) describe(states) ## vars n mean sd median trimmed mad min ## Population 1 50 4246.42 4464.49 2838.50 3384.28 2890.33 365.00 ## Income 2 50 4435.80 614.47 4519.00 4430.08 58...

1226 sym 1 img