Skip to content

Commit

Permalink
slides for week 5
Browse files Browse the repository at this point in the history
  • Loading branch information
atheobold committed Apr 26, 2024
1 parent 459d9e9 commit 281f9d1
Show file tree
Hide file tree
Showing 24 changed files with 254 additions and 242 deletions.
4 changes: 2 additions & 2 deletions _freeze/site_libs/revealjs/dist/theme/quarto.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _freeze/slides/week5-day1/execute-results/html.json

Large diffs are not rendered by default.

Binary file modified _freeze/slides/week5-day1/figure-revealjs/mlr-two-num-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _freeze/slides/week5-day1/figure-revealjs/old-slr-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _freeze/slides/week5-day1/figure-revealjs/two-mlr-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _freeze/slides/week5-day1/figure-revealjs/unnamed-chunk-2-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _freeze/slides/week5-day1/figure-revealjs/unnamed-chunk-3-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions _freeze/slides/week5-day2/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"hash": "0799313ba8729ebc6adeb240e638d890",
"hash": "231908646959eb1a290ad1e6bd329463",
"result": {
"engine": "knitr",
"markdown": "---\ntitle: \"Midterm Project Work Day\"\nformat: \n revealjs:\n theme: style.scss\neditor: visual\n---\n\n\n# Reminders About Deadlines\n\n## {background-color=\"#B6CADA\"}\n\n- Lab 3 Revisions are due today (Thursday, February 8)\n\n- Lab 4 Revisions are due next Thursday (February 15)\n\n::: callout-caution\n# Making a copy of your group's Lab 4\n\nIf you were the recorder (typer) for your group, you need to [make your project public](https://atheobold.github.io/stat-313-website/slides/week4-day2.html#copying-the-lab-last-weeks-recorder). If you were not the recorder, you need to [make a copy of your group's project](https://atheobold.github.io/stat-313-website/slides/week4-day2.html#copying-the-lab-everyone-else).\n:::\n\n- The first draft of your Midterm Project is due on [Sunday at midnight]{.underline}.\n\n# Comments from Project Proposals\n\n## For Every Dataset (in STAT 313)\n\n- [Every]{.underine} dataset is included in an R package! You need to find which package that is and load it in!\n\n- If your dataset is associated with a publication, that publication should be referenced in your Introduction!\n\n## Introduction Versus Methods\n\n- The description of your data goes and your research question goes in your Introduction.\n\n- The description of your variables goes at the beginning of your Methods!\n\n## Specific Dataset Advice\n\n- For the `and_vertebrates` data, you should include `species` as an explanatory variable. If you don't you are assuming the same relationship applies to trout AND salamanders.\n\n- For the `hbr_maples` data, you cannot use `year` as a numerical variable. There are only two years of data!\n\n- For the `pie_crabs` data:\n\n - `size` should be the response variable\n - `site` and `latitude` measure the [same]{.underline} thing\n\n# Coding a Multiple Linear Regression\n\n## {background-color=\"#B6CADA\"}\n\n::: {style=\"font-size: 2em; color: #000000;\"}\nStep 0 -- Read in Your Data\n:::\n\n::: columns\n::: {.column width=\"47%\"}\nSTAT 313\n\n::: small\n- Locate what package your data live in (found in the directions for the midterm project proposal)\n\n- Load in the package you need!\n\n- Get started!\n:::\n:::\n\n::: {.column width=\"3%\"}\n:::\n\n::: {.column width=\"50%\"}\nSTAT 513\n\n::: small\n- Upload your formatted dataset to your Midterm Project on Posit Cloud\n- Write the following code to load in your dataset:\n:::\n:::\n:::\n\n</br>\n\n\n::: {.cell}\n\n```{.r .cell-code}\nname_you_want <- read_xlsx(\"name of your dataset.xlsx\")\n```\n:::\n\n\n**OR**\n\n\n::: {.cell}\n\n```{.r .cell-code}\nname_you_want <- read_csv(\"name of your dataset.csv\")\n```\n:::\n\n\n## {background-color=\"#B6CADA\"}\n\n::: {style=\"font-size: 2em; color: #000000;\"}\nStep 1 -- Visualizations\n:::\n\n::: columns\n::: {.column width=\"47%\"}\n[Two Numerical Variables]{.underline}\n\n::: callout-tip\n# Three total visualizations\n:::\n\n::: small\n- Visualize the model with **both** variables -- `color` gradient\n- Visualize **two** simple linear regression models -- one for each variable\n:::\n:::\n\n::: {.column width=\"3%\"}\n:::\n\n::: {.column width=\"50%\"}\n[One Categorical & One Numerical Variable]{.underline}\n\n::: callout-tip\n# Two total visualizations\n:::\n\n::: small\n- Visualize the model using `geom_smooth(method = \"lm\")`\n- Visualize the model using `geom_parallel_slopes()`\n:::\n:::\n:::\n\n::: callout-warning\n# No `theme_classic()`\n\nI like grid lines! Please use `theme_bw()` instead!\n:::\n\n## {background-color=\"#D4D4D4\"}\n\n::: {style=\"font-size: 2em; color: #000000;\"}\nStep 2 -- Decide the \"Best\" Model\n:::\n\n::: columns\n::: {.column width=\"45%\"}\n[Two Numerical Variables]{.underline}\n\n::: {style=\"color: #0F4C81; font-size: 0.75em\"}\n- If there appears to be a relationship with the colors -- include **both** variables!\n\n- If the colors are equally dispersed throughout the plot -- choose the [**one**]{.underline} variable that has the [**stronger**]{.underline} relationship (larger slope)!\n:::\n:::\n\n::: {.column width=\"5%\"}\n:::\n\n::: {.column width=\"45%\"}\n[One Categorical & One Numerical Variable]{.underline}\n\n::: {style=\"color: #0F4C81; font-size: 0.75em\"}\n- Look at the plot where the lines are allowed to be different! Does it look like they are?\n:::\n:::\n:::\n\n## {background-color=\"#D4D4D4\"}\n\n::: {style=\"font-size: 2em; color: #000000;\"}\nStep 3 -- Fit the regression model with `lm()`\n:::\n\n::: columns\n::: {.column width=\"45%\"}\n[Two Numerical Variables]{.underline}\n\n::: {style=\"color: #0F4C81; font-size: 0.75em\"}\n- Are both variables included? Use a `+` to separate them!\n:::\n:::\n\n::: {.column width=\"5%\"}\n:::\n\n::: {.column width=\"45%\"}\n[One Categorical & One Numerical Variable]{.underline}\n\n::: {style=\"color: #0F4C81; font-size: 0.75em\"}\n- Are the slopes different? You need to fit a different slopes model! Use a `*` to separate the variables!\n\n- Are the slopes similar? You need to fit a parallel slopes model! Use a `+` to separate the variables!\n:::\n:::\n:::\n\n## {background-color=\"#D4D4D4\"}\n\n::: {style=\"font-size: 2em; color: #000000;\"}\nStep 4: Get the coefficients with `get_regression_table()`\n:::\n\n## {background-color=\"#D4D4D4\"}\n\n::: {style=\"font-size: 5em; color: #000000;\"}\nNow interpret!\n:::\n\n<!-- ## {background-color=\"#B6CADA\"} -->\n\n<!-- ::: {style=\"font-size: 2em; color: #000000;\"} -->\n\n<!-- **Hermeneutics** hərmə'n(y)o͞odiks -->\n\n<!-- ::: -->\n\n<!-- > *the study of interpretation* -->\n\n<!-- </br> -->\n\n<!-- . . . -->\n\n<!-- > \"Philosophically, hermeneutics concerns the meaning of interpretation--its basic nature, scope and validity, and its place within and implications for human existance.\" -->\n\n<!-- ## {background-color=\"#D4D4D4\"} -->\n\n<!-- ::: {style=\"font-size: 2em; color: #0F4C81;\"} -->\n\n<!-- **Statistical Hermeneutics** -->\n\n<!-- ::: -->\n\n<!-- > \"The study of the interpretation of results and conclusions based on statistical theory, methods, and reasoning.\" -->\n\n<!-- . . . -->\n\n<!-- - The complexities in interpretations of statistical models, results, etc. are often downplayed and taken for granted. -->\n\n<!-- - It is not often that we are hit with an *explicit* call to discuss our *implicit* interpretations of the statements that arise from our use of statistical methods and results. -->\n\n<!-- ## {background-color=\"#D4D4D4\"} -->\n\n<!-- ::: {style=\"font-size: 2em; color: #0F4C81;\"} -->\n\n<!-- Better for Science -->\n\n<!-- ::: -->\n\n<!-- > \"Modern science despite all of the methodological and technological sophistication, has failed to account for the basic epistemic foundation on which it lies.\" -->\n\n<!-- . . . -->\n\n<!-- - Hermeneutics possesses a positive attitude toward the finitude of human understanding. -->\n\n<!-- - The concern is not to eradicate our finitude, but to recognize the consequences of our limits. -->\n",
"markdown": "---\ntitle: \"Midterm Project Work Day\"\nformat: \n revealjs:\n theme: style.scss\neditor: visual\n---\n\n\n## Reminders About Deadlines\n\n- Lab 3 Revisions are due today (Wednesday, May 1)\n\n- Lab 4 Revisions are due next Wednesday (May 8)\n\n::: callout-caution\n# Making a copy of your group's Lab 4\n\nIf you were the recorder (typer) for your group, you need to [make your project public](https://atheobold.github.io/stat-313-website/slides/week4-day2.html#copying-the-lab-last-weeks-recorder). If you were not the recorder, you need to [make a copy of your group's project](https://atheobold.github.io/stat-313-website/slides/week4-day2.html#copying-the-lab-everyone-else).\n:::\n\n- The first draft of your Midterm Project is due on [Sunday at midnight]{.underline}.\n\n# Comments from Project Proposals\n\n## For Every Dataset (in STAT 313)\n\n- [Every]{.underine} dataset is included in an R package! You need to find which package that is and load it in!\n\n- If your dataset is associated with a publication, that publication should be referenced in your Introduction!\n\n## Introduction Versus Methods\n\n- The description of your data goes and your research question goes in your Introduction.\n\n- The description of your variables goes at the beginning of your Methods!\n\n## Specific Dataset Advice\n\n- For the `and_vertebrates` data, you should include `species` as an explanatory variable. If you don't you are assuming the same relationship applies to trout AND salamanders.\n\n- For the `hbr_maples` data, you cannot use `year` as a numerical variable. There are only two years of data!\n\n- For the `pie_crabs` data:\n\n - `size` should be the response variable\n - `site` and `latitude` measure the [same]{.underline} thing\n\n# Coding a Multiple Linear Regression\n\n## Step 0 -- Read in Your Data\n\n- Locate what package your data live in (found in the directions for the midterm project proposal)\n\n- Load in the package you need!\n\n- Get started!\n\n<!-- ::: columns -->\n<!-- ::: {.column width=\"47%\"} -->\n<!-- STAT 313 -->\n\n<!-- ::: small -->\n<!-- - Locate what package your data live in (found in the directions for the midterm project proposal) -->\n\n<!-- - Load in the package you need! -->\n\n<!-- - Get started! -->\n<!-- ::: -->\n<!-- ::: -->\n\n<!-- ::: {.column width=\"3%\"} -->\n<!-- ::: -->\n\n<!-- ::: {.column width=\"50%\"} -->\n<!-- STAT 513 -->\n\n<!-- ::: small -->\n<!-- - Upload your formatted dataset to your Midterm Project on Posit Cloud -->\n<!-- - Write the following code to load in your dataset: -->\n<!-- ::: -->\n<!-- ::: -->\n<!-- ::: -->\n\n</br>\n\n\n::: {.cell}\n\n```{.r .cell-code code-line-numbers=\"false\"}\nlibrary(openintro)\n```\n:::\n\n::: {.cell}\n\n:::\n\n\n## Step 1 -- Visualizations\n\n::: columns\n::: {.column width=\"47%\"}\n[Two Numerical Variables]{.underline}\n\n::: callout-tip\n# Three total visualizations\n:::\n\n::: small\n- Visualize the model with **both** variables -- `color` gradient\n- Visualize **two** simple linear regression models -- one for each variable\n:::\n:::\n\n::: {.column width=\"3%\"}\n:::\n\n::: {.column width=\"50%\"}\n[One Categorical & One Numerical Variable]{.underline}\n\n::: callout-tip\n# Two total visualizations\n:::\n\n::: small\n- Visualize the model using `geom_smooth(method = \"lm\")`\n- Visualize the model using `geom_parallel_slopes()`\n:::\n:::\n:::\n\n. . .\n\n::: callout-warning\n# No `theme_classic()`\n\nI like grid lines! Please use `theme_bw()` instead!\n:::\n\n## Step 2 -- Decide the \"Best\" Model\n\n::: columns\n::: {.column width=\"45%\"}\n[Two Numerical Variables]{.underline}\n\n::: {style=\"color: #0F4C81; font-size: 0.75em\"}\n- If there appears to be a relationship with the colors -- include **both** variables!\n\n- If the colors are equally dispersed throughout the plot -- choose the [**one**]{.underline} variable that has the [**stronger**]{.underline} relationship (larger slope)!\n:::\n:::\n\n::: {.column width=\"5%\"}\n:::\n\n::: {.column width=\"45%\"}\n[One Categorical & One Numerical Variable]{.underline}\n\n::: {style=\"color: #0F4C81; font-size: 0.75em\"}\n- Look at the plot where the lines are allowed to be different! Does it look like they are?\n:::\n:::\n:::\n\n## Step 3 -- Fit the regression model you chose with `lm()`\n\n::: columns\n::: {.column width=\"45%\"}\n[Two Numerical Variables]{.underline}\n\n::: {style=\"color: #0F4C81; font-size: 0.75em\"}\n- Are both variables included? Use a `+` to separate them!\n\n:::{.small}\n\n::: {.cell}\n\n```{.r .cell-code code-line-numbers=\"false\"}\nmy_model <- lm(size ~ latitude + water_temp, \n data = pie_crab)\n```\n:::\n\n:::\n\n:::\n:::\n\n::: {.column width=\"5%\"}\n:::\n\n::: {.column width=\"45%\"}\n[One Categorical & One Numerical Variable]{.underline}\n\n::: {style=\"color: #0F4C81; font-size: 0.65em\"}\n- Are the slopes different? You need to fit a different slopes model! Use a `*` to separate the variables!\n\n:::{.small}\n\n::: {.cell}\n\n```{.r .cell-code code-line-numbers=\"false\"}\nmy_model <- lm(tail_l ~ age + pop, \n data = possum)\n```\n:::\n\n:::\n\n- Are the slopes similar? You need to fit a parallel slopes model! Use a `+` to separate the variables!\n\n:::{.small}\n\n::: {.cell}\n\n```{.r .cell-code code-line-numbers=\"false\"}\nmy_model <- lm(weight ~ weeks + habit, \n data = births14)\n```\n:::\n\n:::\n:::\n:::\n:::\n\n## Step 4: Get the coefficients with `get_regression_table()`\n\n## {background-color=\"#D4D4D4\"}\n\n::: {style=\"font-size: 5em; color: #000000;\"}\nNow interpret!\n:::\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
Expand Down

0 comments on commit 281f9d1

Please sign in to comment.