class: center, middle, inverse, title-slide # Lab 06: Model selection ### 03.01.19 --- ## Agenda 1. Lab introduction 2. Getting started --- ## Lab introduction - <font class="vocab">Goal: </font> Better understand forward and backward selection and how to conduct these model selection procedures in R - This lab will focus on model selection in the `regsubsets` function using Adj. `\(R^2\)` and BIC as selection criteria - There are many other selection functions and criteria besides those included in this lab - <font class="vocab">Data: </font> - Part I: Average SAT scores and associated state characteristics - Part II: Performance characteristics and salaries of Major League Baseball players - <font class="vocab">Tips: </font> - Use the [Model Selection notes](https://www2.stat.duke.edu/courses/Spring19/sta210.001/slides/lec-slides/12-model-selection.html#1) to help you complete the lab --- ## Getting started with the lab - Go to the course GitHub organization and find the **lab-06** repo that has your team name on it. - On GitHub, click on the green Clone or download button, select Use HTTPS (this might already be selected by default, and if it is, you’ll see the text Clone with HTTPS). Click on the clipboard icon to copy the repo URL. - Go to RStudio Cloud and into the course workspace. Create a New Project from Git Repo. You will need to click on the down arrow next to the New Project button to see this option. - Copy and paste the URL of your assignment repo into the dialog box and click OK. - Run the following in the console to configure Git: ```r library(usethis) use_git_config(user.name="your name", user.email="your email") ``` - **Use the email address associated with your GitHub account** --- ## Caching your password You need to cache your password on a per-project basis: - Go to the **Terminal** within a project (the most recent lab?) - Type the following to cache your password for `\(60 * 60 * 24 * 7 = 604800\)` seconds ```bash git config --global credential.helper 'cache --timeout 604800' ``` You will need to enter your GitHub username and password one more time after caching the password. After that you won't need to enter your credentials for 604800 seconds = 7 days.