Skip to content

Instantly share code, notes, and snippets.

@michaelmhoffman
Created August 18, 2015 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelmhoffman/35d47b46c7514384230f to your computer and use it in GitHub Desktop.
Save michaelmhoffman/35d47b46c7514384230f to your computer and use it in GitHub Desktop.
Is R^2 for five datapoints > 0.8?
set.seed(2015-08-17)
sum(as.integer(lapply(seq(1000), function(i) summary(lm(y ~ x, list(y = runif(5), x = runif(5))))$r.squared > 0.8)))/1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment