Skip to content

Commit

Permalink
Update r-linear-model-overfitting.irnb
Browse files Browse the repository at this point in the history
  • Loading branch information
vsyrgkanis committed Jul 13, 2024
1 parent ecf7732 commit 8fe17b2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions PM1/r-linear-model-overfitting.irnb
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,16 @@
"set.seed(123)\n",
"n <- 1000\n",
"\n",
"p <- .05*n\n",
"x <- matrix(rnorm(n*p), n, p)\n",
"p <- .05 * n\n",
"x <- matrix(rnorm(n * p), n, p)\n",
"y <- rnorm(n)\n",
"\n",
"print(\"p/n is\")\n",
"print(p / n)\n",
"print(\"R2 is\")\n",
"print(summary(lm(y ~ x))$r.squared)\n",
"print(\"Adjusted R2 is\")\n",
"print(summary(lm(y ~ x))$adj.r.squared)\n",
"\n"
"print(summary(lm(y ~ x))$adj.r.squared)\n"
]
}
],
Expand Down

0 comments on commit 8fe17b2

Please sign in to comment.