Skip to content

Instantly share code, notes, and snippets.

@malcolmbarrett
Created April 15, 2020 14:45
Show Gist options
  • Select an option

  • Save malcolmbarrett/5ae1dee4ad341b5aa37b5656699f9d4e to your computer and use it in GitHub Desktop.

Select an option

Save malcolmbarrett/5ae1dee4ad341b5aa37b5656699f9d4e to your computer and use it in GitHub Desktop.
set.seed(1234)
c <- rnorm(1000)
e <- c * 2 + rnorm(1000)
o <- e * 3 + c *.5 + rnorm(1000)
s <- o * -1.5 + rnorm(1000)
df <- data.frame(c, e, o, s)
broom::tidy(lm(o ~ e + c, data = df))
broom::tidy(lm(o ~ e + c + s, data = df))
broom::tidy(lm(o ~ e + s, data = df))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment