Aug 27, 2024
Kat Husar (PhD): Head TA + Lab 02 leader
Jon Campbell (MS): Lab 01 leader
Ishrit Gupta (UG): Lab 01 helper
Alan Wang (UG): Lab 02 helper
Click on the link or scan the QR code to answer the Ed Discussion poll
https://edstem.org/us/courses/62513/discussion/625046
Introduction to the course
Syllabus activity
Reproducibility
Regression analysis is a statistical method used to examine the relationship between a response variable and one or more predictor variables. It is used for predicting future values, understanding relationships between variables, and identifying key predictors. It also helps in modeling trends, assessing the impact of changes, and detecting outliers in data.
Source: ChatGPT (with modification)
New Yorkers Will Pay $56 A Month To Trim A Minute Off Their Commute
\[ \text{rent} = \beta_0 + \beta_1 ~ \text{commute_time} + \epsilon \]
\[ \begin{bmatrix} y_1 \\ y_2 \\ \vdots \\ y_n \end{bmatrix} = \begin{bmatrix} 1 & x_1 \\ 1 & x_2 \\ \vdots & \vdots \\ 1 & x_n \end{bmatrix} \begin{bmatrix} \beta_0 \\ \beta_1 \\ \end{bmatrix} + \begin{bmatrix} \epsilon_1 \\ \epsilon_2 \\ \vdots \\ \epsilon_n \end{bmatrix} \]
Application
Theory
Prerequisites: Introductory statistics or probability course and linear algebra
Recommended corequisite: Probability course at Duke
By the end of the semester, you will be able to…
All analyses using R, a statistical programming language
Write reproducible reports in Quarto
Access RStudio through STA 210 Docker Containers
Access assignments
Facilitates version control and collaboration
All work in STA 221 course organization
It is my intent that students from all diverse backgrounds and perspectives be well-served by this course, that students’ learning needs be addressed both in and out of class, and that the diversity that the students bring to this class be viewed as a resource, strength and benefit.
If you have a name that differs from those that appear in your official Duke records, please let me know.
Please let me know your preferred pronouns, if you are comfortable sharing.
If you feel like your performance in the class is being impacted by your experiences outside of class, please don’t hesitate to come and talk with me. If you prefer to speak with someone outside of the course, your advisers and deans are excellent resources.
I (like many people) am still in the process of learning about diverse perspectives and identities. If something was said or done in class (by anyone) that made you feel uncomfortable, please talk to me about it.
The Student Disability Access Office (SDAO) is available to ensure that students are able to engage with their courses and related assignments.
If you have documented accommodations from SDAO, please send the documentation as soon as possible.
I am committed to making all course activities and materials accessible. If any course component is not accessible to you in any way, please don’t hesitate to let me know.
Group 1: What to expect in lectures and labs
Group 2: Homework and lab assignments
Group 3: Exams and project
Group 5: Academic honesty (except AI policy)
Group 6: Artificial intelligence policy
Group 7: Late work policy and waiver for extenuating circumstances
Group 9: Getting help in the course
Group 1: What to expect in lectures and labs
Group 2: Homework and lab assignments
Group 3: Exams and project
Group 5: Academic honesty (except AI policy)
Group 6: Artificial intelligence policy
Group 7: Late work policy and waiver for extenuating circumstances
Group 9: Getting help in the course
Category | Percentage |
---|---|
Homework | 25% |
Final project | 15% |
Lab | 15% |
Exam 01 | 20% |
Exam 02 | 20% |
Participation (AEs and teamwork) | 5% |
Total | 100% |
Complete all the preparation work before class.
Ask questions in class, office hours, and on Ed Discussion.
Do the homework and labs; get started on homework early when possible.
Don’t procrastinate and don’t let a week pass by with lingering questions.
Stay up-to-date on announcements on Ed Discussion and sent via email.
Raise your hand or post under the Lectures channel on Ed Discussion.
What does it mean for an analysis to be reproducible?
Near term goals:
✔️ Can the tables and figures be exactly reproduced from the code and data?
✔️ Does the code actually do what you think it does?
✔️ In addition to what was done, is it clear why it was done?
Long term goals:
✔️ Can the code be used for other data?
✔️ Can you extend the code to do other things?
Results produced are more reliable and trustworthy (Ostblom and Timbers 2022)
Facilitates more effective collaboration (Ostblom and Timbers 2022)
Contributing to science, which builds and organizes knowledge in terms of testable hypotheses (Alexander 2023)
Possible to identify and correct errors or biases in the analysis process (Alexander 2023)
Scriptability \(\rightarrow\) R
Literate programming (code, narrative, output in one place) \(\rightarrow\) Quarto
Version control \(\rightarrow\) Git / GitHub
R is a statistical programming language
RStudio is a convenient interface for R (an integrated development environment, IDE)
Fully reproducible reports – the analysis is run from the beginning each time you render
Code goes in chunks and narrative goes outside of chunks
Visual editor to make document editing experience similar to a word processor (Google docs, Word, Pages, etc.)
Every application exercise and assignment is written in a Quarto document
You’ll have a template Quarto document to start with
The amount of scaffolding in the template will decrease over the semester
with human readable messages
Provides a clear record of how the analysis methods evolved. This makes analysis auditable and thus more trustworthy and reliable. (Ostblom and Timbers 2022)
Complete Lab 00 tasks
Review syllabus
Complete reading to prepare for Thursday’s lecture
Thursday’s lecture: Simple linear regression