class: center, middle, inverse, title-slide # Welcome to Linear Models ### Dr. D’Agostino McGowan --- layout: true <div class="my-footer"> <span> Dr. Lucy D'Agostino McGowan </span> </div> --- ## 👋 ## Lucy D'Agostino McGowan <i class="fa fa-envelope"></i> [mcgowald@wfu.edu](mailto:mcgowald@wfu.edu) <br> <i class="fa fa-calendar"></i> Tues/Thurs 9:30a-10:45a, 12:30p-1:45p --- class: middle, center Everything you will need will be posted at: # [bit.ly/sta-312-f20](http://bit.ly/sta-312-f20) --- class: center, middle ### "truth … is much too complicated to allow anything but approximations" - John von Neumann <img src = "https://farkasdilemma.files.wordpress.com/2013/01/vonneumann.png" height = "350"> </img> <font size = "2"> John von Neumann, wearer of funny hats via <a href = "https://farkasdilemma.wordpress.com/2013/01/04/john-von-neumannm-wearer-of-funny-hats/"> farkasdilemma.wordpress.com</a> </font> --- class: center, middle ### "Statistics is using data and knowledge about randomness to condense, communicate, and contextualize information and provide insight into the setting from which the data came." - Jo Hardin <img src = "https://research.pomona.edu/johardin/files/2012/08/jo_headshot3-3.png" height = "270"> </img> <font size = "2"> Jo Hardin <a href = "https://research.pomona.edu/johardin/files/2012/08/jo_headshot3-3.png"> https://research.pomona.edu/johardin/</a> </font> --- class: center, middle ### "All models are wrong, but some are useful" - George Box <img height="400" alt="GeorgeEPBox" src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/GeorgeEPBox.jpg/256px-GeorgeEPBox.jpg"></img> <font size = "2"> DavidMCEddy at en.wikipedia <a href = "https://creativecommons.org/licenses/by-sa/3.0"> CC BY-SA 3.0 </a>, via Wikimedia Commons </font> --- class: center, middle .question[ # data = model + error ] --- class: center, middle .question[ $$ \LARGE y = f(\mathbf{X}) + \epsilon $$ ] # 🗣 math speak --- class: center, middle .question[ $$ \LARGE y = \color{blue}{f(\mathbf{X})} + \epsilon $$ ] # model --- class: center, middle .question[ $$ \LARGE y = f(\color{blue}{\mathbf{X}}) + \epsilon $$ ] # data (to build the model) --- class: center, middle .question[ $$ \LARGE \color{blue}y = f(\mathbf{X}) + \epsilon $$ ] # data (outcome) --- class: center, middle .question[ $$ \LARGE y = \color{blue}{\beta_0 + \beta_1X }+ \epsilon $$ ] # Simple Linear Regression --- class: center, middle ![](https://upload.wikimedia.org/wikipedia/en/7/70/Bob_at_Easel.jpg) <font size = "2"> Bob at Easel from <a href = "https://en.wikipedia.org/wiki/File:Bob_at_Easel.jpg">Wikipedia</a></font> --- .pull-left[ ![](https://upload.wikimedia.org/wikipedia/en/7/70/Bob_at_Easel.jpg) ] .pull-right[ ![](01-welcome_files/figure-html/unnamed-chunk-2-1.png)<!-- --> ] ### Data: [FiveThirtyEight](https://fivethirtyeight.com/features/a-statistical-analysis-of-the-work-of-bob-ross/) --- .pull-left[ ![](https://upload.wikimedia.org/wikipedia/en/7/70/Bob_at_Easel.jpg) ] .pull-right[ ![](01-welcome_files/figure-html/unnamed-chunk-3-1.png)<!-- --> ] --- .pull-left[ ![](https://upload.wikimedia.org/wikipedia/en/7/70/Bob_at_Easel.jpg) ] .pull-right[ ![](01-welcome_files/figure-html/unnamed-chunk-4-1.png)<!-- --> ] .question[ $$ \LARGE y = \color{blue}{\beta_0 + \beta_1X }+ \epsilon $$ ] --- .pull-left[ ![](https://upload.wikimedia.org/wikipedia/en/7/70/Bob_at_Easel.jpg) ] .pull-right[ ![](01-welcome_files/figure-html/unnamed-chunk-5-1.png)<!-- --> ] .question[ $$ \text{# of paintings with clouds} = \color{blue}{\beta_0 + \beta_1 season }+ \epsilon $$ ] --- .pull-left[ ![](https://upload.wikimedia.org/wikipedia/en/7/70/Bob_at_Easel.jpg) ] .pull-right[ ![](01-welcome_files/figure-html/unnamed-chunk-6-1.png)<!-- --> ] .question[ $$ \text{# of paintings with clouds} = \color{blue}{\beta_0 + \beta_1 season }+ \epsilon $$ ] --- .pull-left[ ![](https://upload.wikimedia.org/wikipedia/en/7/70/Bob_at_Easel.jpg) ] .pull-right[ ![](01-welcome_files/figure-html/unnamed-chunk-7-1.png)<!-- --> ] .question[ $$ \text{# of paintings with clouds} = \color{blue}{\beta_0 + \beta_1 f(season) }+ \epsilon $$ ] --- class: center, middle .question[ $$ \LARGE y = \color{blue}{\beta_0 + \beta_1X_1 + \beta_2X_2+... }+ \epsilon $$ ] # Multiple Linear Regression --- class: center, middle # Let's go! --- ## Log into RStudio Pro - **Note:** if you are off campus, you will need to use a [VPN to connect](https://is.wfu.edu/services/vpn/) - Go to [rstudio.hpc.ar53.wfu.edu:8787](rstudio.hpc.ar53.wfu.edu:8787) - Your username is your WFU username (typically the first part of your email) - The password is: **R2D2Star!** --- class: inverse
05
:
00
## <i class="fas fa-laptop"></i> `Penguin fun!` - Once you log on to RStudio Pro, find the project `01-welcome-penguins`, click it - In the Files pane in the bottom right corner, spot the file called `welcome-penguins.Rmd`. Open it, and then click on the "Knit" button. - Go back to the file and change your name on top (in the `yaml` -- we'll talk about what this means later) and knit again. - Then, scroll to the `plot` chunk, below **Palmer Penguins**. Instead of looking at the relationship between flipper length and bill length, plot the relationship between flipper length and bill **depth**. _Hint, look at the full dataset at the bottom of the document for variable names, update the captions to match your new plot_. Knit again & voila! ---