STA 9750 - Week 3 Update

Michael Weylandt

Today

Today

  • Introduction to Course Project
  • Special Presentation
  • Course Administration
  • R: Data Frames, Functions, Packages and Control Flow

Course Project Overview

Course Project

  • Teams: 3-4 classmates
  • Stages:
    • Proposal (in class presentation)
    • Mid-semester check-in (in class presentation)
    • Final: in class presentation, individual report, summary report
  • Structure:
    • Shared “Overarching Question”
    • Individual “Specific Question” (one per teammate)

Full description online

Finding Data

Presentation Hints

  • Longest time \(\neq\) most important
  • Story, story, story! Why are you making these choices?
  • Hourglass Structure
    • Start big
    • Motivate your overarching question
    • Specific questions
    • Tie specific to overarching
    • From overarching back to big motivation
  • No less than one figure every other slide

Special Presentation
Jason Amey
Newman Library

Course Administration

MP#00 Submissions

I now have GitHub IDs for 22 of you.

  • If you are in the 6 who have not sent me your GitHub ID and received my acknowledgement please do so immediately.

  • Will follow up with a few of you for VoE directly

  • Great submissions: Resumes, Bios, Flowcharts (creative!), Headshots

MP#00 Goals

MP#00 is ungraded to:

  1. Sort out tech trouble
  2. Show danger of waiting to the last minute
  3. Demonstrate importance of closely following instructions Hopefully lessons learned will be helpful in future assignments

MP#00 Peer Feedback

Due to a constraint of GitHub’s API, need to do issue creation and tagging on my STA9750-2025-SPRING repository.

Instructions updated for MP#01-#04 already.

  • Helper scripts to be updated as well

For MP#00, I am hand-copying all issues to my repo and assigning peer feedback there (done by noon tomorrow)

MP#00 Peer Feedback

3 evaluators per submission

Goals:

  • Practice commenting on GitHub and reviewing code (ungraded assignment)
  • Learn tricks to improve your own site

“Good artists copy; great artists steal.” – Steve Jobs

MP#01 Extended Deadlines

  • Released: today (unchanged)
  • Due: 2025-03-05 (extend one week)
  • Peer Feedback Assigned: 2025-03-06 (shift one week)
  • Peer Feedback Due: 2025-03-12 (shift one week)

MP#01 Peer Feedback is day before Project Proposals

  • No Pre-Assignment that week

STA 9750 Mini-Project #01

  • MP#01 released
  • Start early
    • Not too hard if everything is working (post-MP#00)
    • Tech support takes time

Found on Course Site

Piazza Participation

  • Average time to response: 15 minutes
  • 154 posts

Thanks to those of you who are helping classmates!

Upcoming Week

Next Wednesday at 11:45pm:

  • Next Pre-Assignment
  • MP#00 Peer Feedback due

Pre-Assignment #03 FAQs

FAQ: Vector Index Printout Rules

Default vector printing:

1:10
 [1]  1  2  3  4  5  6  7  8  9 10

Each line gets a new index:

sqrt(1:10)
 [1] 1.000000 1.414214 1.732051 2.000000 2.236068 2.449490 2.645751 2.828427
 [9] 3.000000 3.162278

More complex objects have alternate print styles:

matrix(1:9, nrow=3, ncol=3)
     [,1] [,2] [,3]
[1,]    1    4    7
[2,]    2    5    8
[3,]    3    6    9

Print width is controlled by getOption("width").

FAQ: Recycling Rules

Alignment by default:

x <- 1:3
y <- 4:6
x + y
[1] 5 7 9

Recycling by default:

x <- 1
y <- 4:6
x + y
[1] 5 6 7

Recycle warning when vectors don’t fit together cleanly:

x <- 1:2
y <- 4:6
x + y
Warning in x + y: longer object length is not a multiple of shorter object
length
[1] 5 7 7

FAQ: Recycling Warning

x <- 1:2
y <- 4:6
x + y
Warning in x + y: longer object length is not a multiple of shorter object
length
[1] 5 7 7

Not a problem per se, but often a sign that something has gone wrong.

  • scalar + vector is usually safe
  • 2 vectors of same size is usually safe
  • vectors of different size is usually a programming mistake

FAQ: Warnings vs Errors

  • Warnings: heuristics pointing at typical problem
    • Code still executed without a problem
    • Try to fix these unless you’re certain it’s not a problem
  • Errors: code failed to execute
    • You have to fix these to run your code

FAQ: Changing built-in functions

Most built-in functions can’t / shouldn’t be changed.

Some allow alternate behavior via additional arguments:

log(10) # Default is natural (base e) logarithm
[1] 2.302585
log(10, base=10)
[1] 1

If you want different behavior, write your own function:

cosd <- function(x){
    ## Cosine in degrees
    cos(x * pi / 180)
}
cosd(90)
[1] 6.123234e-17

Always try ?name to see documentation.

FAQ: Git Workflow

Three key commands:

  • git add: add some changes to a ‘box’
  • git commit: seal the ‘box’
  • git push: send the ‘box’ to GitHub

Git pane in RStudio shows uncommited changes, not files.

If a file ‘vanishes’ after a commit, that’s good!

R: Data Frames, Functions, Packages and Control Flow

Data Frames

Function Calls

Packages

Control Flow

Wrap-Up

Looking Ahead

Course Project:

  • Start looking for teammates and topics
  • No in-person office hours on 2025-02-18 (MW on travel)

Life Tip of the Week

Recommendations from Professors

In the near future, you may want recommendations from your professors. Some advice on getting good recommendations:

  1. Understand professional vs academic recommendations
  2. Seek out strong recommendations
  3. Confidential recommendations highly preferrable

Professional vs Academic Recommendations

  • Professional: For a job. Typically a brief survey.

  • Academic: For awards, fellowships, research positions, graduate admissions. A personalized letter from me.

I can usually do professional recommendations quickly. Academic recommendations require a minimum of two weeks.

Strong Recommendations

A strong recommendation is one that supplements what is already in your application.

  • Say things that aren’t on your transcript
  • Attest to character and quality of work

The better I know you, the stronger a letter I can write.

You can ask if a professor can write you a strong recommendation. If they say they can write, but it may not be strong, consider asking elsewhere.

Strong Recommendations

Ugly:

Student N took my class and received an A.

Bad:

Student N took my XYZ class and received an A. My XYZ class covers ABC at an advanced level and provides N a strong foundation for your program.

Good:

I first met student N in my XYZ class. She was an active participant in class, regularly attended my office hours, and regularly asked for additional advanced material. She had a remarkable final project in which she ABC. It is clear that her drive and passion for XYZ make her an excellent candidate for your fellowship.

Confidentiality

Under some parts of US law, you have the right to see what letters for you I write unless you specifically waive that right.

Waive the right

Readers will assume you have read a non-confidential letter and discount whatever I say.

My Policy

I will write a letter for any student who has passed one of my classes (C or higher) or is on track to do so.

No guarantee it is strong unless you ask. I understand that sometimes you are just trying to make sure you have enough.

Give me at least 2 weeks, ideally more.

Send me:

  • Description of who I’m writing to
  • Your CV / Resume
  • Your latest transcript
  • Presentations/project materials from my class

Once I have a letter written, it’s easier for me to update and re-use.

Help me help you.