Created
July 3, 2025 16:51
-
-
Save mvuorre/537a8e41d57f504ba1f375fa867ba57e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| title: A linear regression example | |
| author: Matti Vuorre | |
| format: typst | |
| --- | |
| What is the regression coefficient of $y$ on $x$? Find out in @tbl-1 (see @lst-1)! | |
| ```{r} | |
| #| label: tbl-1 | |
| #| lst-label: lst-1 | |
| #| lst-cap: Linear regression in R. | |
| #| tbl-cap: Revealing the relationship between y and x. | |
| x <- rnorm(30) | |
| y <- rnorm(30) + 0.1 * x | |
| model <- lm(y ~ x) | |
| knitr::kable(broom::tidy(model), digits = 2) | |
| ``` |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Screenshot of output pdf: