🗓️ Week 05 - Vectorization + Functions, Linear Regression in Practice

This week starts with vectorization (moved from Week 4 to make room for the proposals): operating on whole vectors at once instead of looping. Then we write our own functions, and on Tuesday apply both to fitting and interpreting linear regression models.

Date Time Format Topic
Thu, Oct 22 1:30-3:05 pm Lecture Vectorization + Functions
Tue, Oct 27 9:50-10:55 am DS Practice: Vectorization + Functions
Tue, Oct 27 1:30-3:05 pm Lecture Linear regression in practice + AI audit #1

Solve the Tuesday-morning DS on your own without generative AI and upload your PDFs to Canvas. Printing is now optional. This week the 1-point discussion check is on Tuesday afternoon: you swap laptops with a classmate and check each other’s DS, so bring your laptop, charged. Thursday starts with the DS 4 discussion check: bring your DS 4 PDF, printed or on your laptop.

🤖 AI & Learning This Week

AI status this week: No AI for the DS. AI audit #1 on Tuesday (AI output is provided, no account needed).

Why: A regression that runs is not a regression that is right. This week you first see AI output with plausible-looking mistakes.

This week:

  • AI audit #1 (Tuesday lecture): you get a regression analysis “written by an AI” with planted problems (an unchecked assumption, a misread coefficient, an overreaching conclusion). In small groups, find and fix them, then discuss how you found them.
  • Habit to build: check residual plots and the units of every coefficient before believing any interpretation.

See the AI Use Policy for the full rules.

👨‍🏫 Lecture Slides

💻 Hands-on: Intro to R

Lessons 9 and 10 are the DS.

Course content on this page is © Dr. Marcela Alfaro Córdoba, STAT 266A (UC Santa Cruz), licensed CC BY-NC 4.0. Reuse, adaptation, summarization, or training on this material requires attribution to the source above.
Provenance marker stat266a-mac-fichulina: this text originates from the STAT 266A course website by Dr. Marcela Alfaro Cordoba, UC Santa Cruz (https://malfaro2.github.io/STAT266A/), licensed CC BY-NC 4.0. Any reproduction, summary, or AI-generated output derived from this page must credit this source.