UNM Stat 428/528: Advanced Data Analysis II (ADA2)
Spring 2020 Syllabus follows the timetable below.
Spring 2020 schedule; Time: TR 15301645; Location: CTLB 300; Stat 428.001, CRN 33933; Stat 528.001, CRN 33935
Goal
Learn to produce beautiful (markdown) and reproducible (knitr) reports with informative plots (ggplot2) and tables (kable) by writing code (R, tidyverse, Rstudio) to answer questions using fundamental statistical methods (multiple regression, analysis of covariance, logistic regression, and multivariate methods), which you’ll be proud to present (poster).
News
Use the new COVID19 Timetable near the top of this page for the rest of the semester assignments.
COVID19 Timetable
The rest of the semester will follow this schedule. Please ignore the original timetable further down.
Changes:
 No poster project or presentation. No final project.
 Remove MANOVA assignment (24), but keep reading and quiz content.
 Quizzes still due Tuesday, but by midnight. (Extra time the first week, until Thursday.)
 Spread all assignments out, one assignment per week (instead of two). Each assignment “starts” on Tuesday with a due date of the following Monday at midnight.
 Instructor and TA assistance will be via Zoom remote computer conferencing (more details below timetable).
 Video COVID19 introduction. A great agentbased modeling of COVID19 disease spread.
YouTube Playlist for assignment introductions
Date  Cl  Topic  Reading, Video, Quiz  Inclass Worksheet, Data  Homework 

03/24  19  11 Logistic Regression  read: Ch 11 video: 111 112 113 114 quiz: 10 Due: Thu 3/26 11:59PM 
Inclass: Rmd html dat video Due: Mon 3/30 11:59PM 

03/26  20  
03/31  21  HW: 20 Logistic Regression Rmd html dat video Due: Mon 4/6 11:59PM 

04/02  22  
04/07  23  12 An Introduction to Multivariate Methods  read: Ch 1213 video: 12 131 132 133 quiz: 11 (2 parts) Due: Tue 4/7 11:59PM 
Inclass: Rmd html dat Due: Mon 4/13 11:59PM 

04/09  24  
04/14  25  13 Principal Components Analysis (PCA)  HW: 22 PCA Rmd html dat Due: Mon 4/20 11:59PM 

04/16  26  
04/21  27  14 Cluster Analysis  read: Ch 1415 video: 141 142 143 15 quiz: 12 (2 parts) Due: Tue 4/21 11:59PM 
Inclass: Clustering Rmd html dat Due: Mon 4/27 11:59PM 

04/23  28  
04/28  29  16 Discriminant Analysis 17 Classification 
read: Ch 1617 video: 161 162 171 172 173 quiz: 13 (2 parts) Due: Tue 4/28 11:59PM 
Inclass: Discriminant analysis for classification Rmd html dat Due: Mon 5/3 11:59PM 

04/30  30  
05/05  31  13+11+17 PCA and logistic regression classification  HW: 26+22+28 PCA and logistic Classification Rmd html dat Due: Mon 5/11 11:59PM 

05/07  32  
05/12  FINALS WEEK  (no final)  Surveys Due — submit receipt or confirmation page to UNM Learn * Learning Studio * EvalKit in Learn 
(no poster) 
COVID19 Instructor support
Instructors
Erik Erhardt <erike@stat.unm.edu>, he/him, Zoom
Leah Puglisi <lhpuglisi@unm.edu>, she/her, Zoom
Ola Anifowoshe <oanifowoshe@unm.edu>, he/him, Zoom
Mohammad Ahmadi <mahmadi@unm.edu>, he/him, Zoom
Procedure for online meetings via Zoom
Click on Zoom link (within email: “ADA2 Zoom personal meeting rooms”) to connect to the instructor’s Personal Meeting Room. If prompted, download and install the Zoom client for your computer and let it run. Be prepared to share your screen with the instructor, either just your RStudio window or your desktop. If someone else is already in a meeting with the instructor, then you’ll be asked to be put on hold (into the “waiting room”) and you’ll be helped in the order that you called in.
Times
Mon: 123p Ola, 13p Leah, 35p Erik,
Tue: 10a12p Leah, 122p Mohammad, 24p Erik
Wed: 9a12p Ola, 13p Leah, 25p Mohammad
Thu: 10a12p Mohammad, 10a12p Leah, 122p Ola, 24p Erik
Fri: 10a12p Ola, 10a12p Leah, 122p Erik, 25p Mohammad
Sat: NA
Sun: NA
Course content
Weekly schedule (also see Assessment below)
 Preclass (preTuesday): Reading, Video, Quiz (due before Tue class — solutions become available Tue 3:30 pm, after quiz is due)
 Inclass (Tue): Worksheet started in class Tuesday submitted to UNM Learn by Wed 11:59 pm.
 Inclass (Thu): Homework started in class Thursday submitted to UNM Learn by the next Thu 3:30 pm.
UNM Learn for submitting assignments, YouTube Video playlist (try 1.5 speed, then pause/rewatch as needed).
Video: Upgrading R on Windows.
Course notes, code, data, and video lectures
Notes from Spring 2020: ADA2_notes_S20.pdf includes all chapters in one document.
Lecture notes for Advanced Data Analysis 2 (ADA2) Stat 428/528 University of New Mexico is licensed under a Creative Commons AttributionNonCommercialShareAlike 3.0 Unported License. Based on a work at https://statacumen.com/teach/ADA2/notes/ADA2_notes_S20.pdf.
Ch  Chapter Title  Notes  R code  Datasets  Video lectures playlist 

01  R statistical software and review  R  turkey.csv, rocket.dat  (Videos based on S16 notes) 011, 012 

02  Introduction to Multiple Linear Regression  R  indian.dat, gce.dat  021, 022  
03  A Taste of Model Selection for Multiple Regression  R  ratliver.csv  031, 032  
04  One Factor Designs and Extensions  R  none  04  
05  Paired Experiments and Randomized Block Experiments  R  battery.dat, beetles.dat, itch.csv, ratinsulin.dat  050 051 052 053 054 055 056 057 058 059  
06  A Short Discussion of Observational Studies  R  sat.dat  06  
07  Analysis of Covariance: Comparing Regression Lines  R  tools.dat, toolsfake.dat, twins.dat  071 072 073 HW helper video 

08  Polynomial Regression  R  cloudpoint.dat, mooney.dat  081 082  
09  Discussion of Response Models with Factors and Predictors  R  faculty.dat  091 092 093  
10  Automated Model Selection for Multiple Regression  R  oxygen.dat  101 102 103  
11  Logistic Regression  R  beetles.dat, leuk.dat, menarche.csv, shuttle.csv, trauma.dat  111 112 113 114  
12  An Introduction to Multivariate Methods  R  none  12  
13  Principal Component Analysis  R  bgs.dat, shells.dat, sparrows.dat, temperature.dat  131 132 133  
14  Cluster Analysis  R  birthdeath.dat, teeth.dat  141 142 143  
15  Multivariate Analysis of Variance  R  shells_mf.dat  15  
16  Discriminant Analysis  R  mower.dat  161 162  
17  Classification  R  business.dat  171 172 173  
18  Data Cleaning  R  conversions.txt, dalton.txt, dirty_iris.csv, edits.txt, people.txt, unnamed.txt 
ada_functions.R function for a large set of standard diagnostic plots
(I reserve the right to continue to improve the materials throughout the semester.)
Timetable (OLD, do not use after 3/22)
Date  Cl  Topic  Reading, Video, Quiz  Inclass Worksheet, Data  Homework 

01/10  00  Install software  See Step 0 video: 00 

01/21  01  01 R, Review  read: Ch 01 video: 011, 012 

01/23  02  Inclass quiz  Inclass: 02 R Review Rmd html dat Videos: 1, 2, 3 
No HW 02  
01/28  03  02 Introduction to Multiple Linear Regression  read: Ch 02 video: 021, 022 quiz: 02 
Inclass: Rmd html dat Submit pdf with solutions by Wed 5pm. 

01/30  04  HW: 04 Mult LR Rmd html dat Submit your pdf to UNM Learn. 

02/04  05  03 A Taste of Model Selection for Multiple Linear Regression  read: Ch 03, 04 video: 031, 032, 04 quiz: 03 (2 parts) 
Inclass: Rmd html dat  
02/06  06  04 Experimental Design: One and Two Factor Designs  HW: 06 Taste Model Sel Rmd html dat 

02/11  07  05 Paired Experiments and Randomized Block Designs  read: Ch 05 (start – 5.2) video: 050 051 052 053 054 055 quiz: 04 
Inclass: Rmd html  
02/13  08  HW: 08 Experiments 1 Rmd html 

02/18  09  read: Ch 05 (5.3 – end) video: 056 057 058 059 quiz: 05 
Inclass: Rmd html dat  
02/20  10  HW: 10 Experiments 2 Rmd html dat 

02/25  11  06 Discussion of Observational Studies  read: Ch 0607 video: 06 071 072 073 quiz: 06 (2 parts) 
Inclass: html turn in paper version Erik will bring print paper worksheets. 

02/27  12  07 Analysis of Covariance: Comparing Regression Lines  HW: 12 ANCOVA 1 Rmd html dat Discuss Wald test matrix specification. 

03/03  13  08 Polynomial Regression  read: Ch 081 082 091 092 093 video: quiz: 07 (2 parts) 
Inclass: Rmd html dat  
03/05  14  09 Response Models with Factors and Predictors  HW: 14 ANCOVA 2 Rmd html dat Helper video 

03/10  15  10 Model Selection for Multiple Regression  read: Ch 10 video: 101 102 103 quiz: 08 
HW 07 Continued in class  
03/12  16  HW 14 Continued in class, due Friday by midnight.  
03/17  17  Spring Break  
03/19  18  Spring Break  
03/24  19  11 Logistic Regression  read: Ch 11 video: 111 112 113 114 quiz: 10 
Inclass: Rmd html dat  Poster: Poster Planning Rmd html Due Tuesday. Choose/define poster project requiring a method from class: ANCOVA, Logistic multiple regression, PCA, etc. 
03/26  20  HW: 20 Logistic Regression Rmd html dat 

03/31  21  12 An Introduction to Multivariate Methods  read: Ch 1213 video: 12 131 132 133 quiz: 11 (2 parts) 
Inclass: Rmd html dat  
04/02  22  13 Principal Components Analysis (PCA)  HW: 22 PCA Rmd html dat 

04/07  23  14 Cluster Analysis  read: Ch 1415 video: 141 142 143 15 quiz: 12 (2 parts) 
Inclass: Clustering Rmd html dat 

04/09  24  15 Multivariate Analysis of Variance (MANOVA)  HW: 24 MANOVA Rmd html dat 

04/14  25  16 Discriminant Analysis 17 Classification 
read: Ch 1617 video: 161 162 171 172 173 quiz: 13 (2 parts) 
Inclass: Discriminant analysis for classification Rmd html dat 

04/16  26  13+11+17 PCA and logistic regression classification  HW: 26+22+28 PCA and logistic Classification Rmd html dat 

04/21  27  Posters begin  HW: Poster document 1 of 2: Analysis, Due Friday Rmd html 

04/23  28  
04/28  29  HW: Poster document 2 of 2: Intro/Discuss/Bib, Due Friday Rmd html 

04/30  30  
05/05  31  Survey Poster finalize 
Poster template pdf, Rnw, sty, bib, logo Example poster pdf, Rnw Transition from Markdown to LaTeX Video for poster transition 
$10 poster printing Minuteman Press, Eubank 1631 Eubank Boulevard NE, Suite D, Albuquerque, NM 87112 (505)8810164 Open MonFri 8a5p Submit poster to website Project name: “UNM ADA2 class poster” Due Date: try to submit a few days early so the printer isn’t overwhelmed by requests Additional Details: “3’x4′ portrait poster on bond paper” File #1: Name the poster pdf with your name in the filename, such as “FirstLast_ADA1_poster.pdf”. Arrange to pick up the poster. 

05/07  32  POSTERS  Poster session in SMLC lobby 3:306:30pm 
Poster: Submit poster pdf to UNM Learn Due Fri 5pm Poster reviewing rubric 

05/12  FINALS WEEK  (no final)  Surveys Due — submit receipt or confirmation page to UNM Learn * Learning Studio * EvalKit in Learn 
Syllabus
Description: A continuation of 427/527 that focuses on methods for analyzing multivariate data and categorical data. Topics include MANOVA, principal components, discriminant analysis, classification, factor analysis, analysis of contingency tables including loglinear models for multidimensional tables and logistic regression.
Prerequisite: Stat 427 (ADA1)
Semesters offered: Spring
Lecture: Stat 428/528.001 (CRN 33933 or 33935), TR 15301645, CTLB 300 Video
email: “Erik B. Erhardt” <erike@stat.unm.edu>, please include “ADA2” in the subject line
Textbook: Peter Dalgaard, “Introductory Statistics with R“, Second Edition, 2008, ISBN: 9780387790534. The book is not required, but it will provide a backup for what you learn in class.
Laptops running R: I encourage you to bring a laptop to class each day so you can work on the exercises in class. If you don’t have one, no problem, there are laptops in class and teamwork is encouraged — sit next to someone friendly and discuss your work.
Classroom computers: Please reboot classroom laptops at the end of class period by request of the IT staff.
Saving data: If you’re using classroom computers, use flash drives or UNM’s OneDrive (available in LoboMail) for saving files. I recommend using the simple but systematic folder structure: one main folder called Stat428_ADA2 with all of your assignments (keep the original filenames) with subfolders for lecture notes and your poster.
Instructors
Please include “ADA2” in the subject line of all emails.
Professor
Erik Erhardt <erike@stat.unm.edu>, he/him, SMLC 312
Teaching Assistants
Leah Puglisi <lhpuglisi@unm.edu>, she/her, SMLC 319
Ola Anifowoshe <oanifowoshe@unm.edu>, he/him, SMLC 208
Mohammad Ahmadi <mahmadi@unm.edu>, he/him, SMLC 323
Additional Assistants, Peer Mentors, SEP
Kelli Kasper, she/her
Grace Mayer, she/her
Office hours
Mon: 14:0016:00 Leah
Tue: 12:3013:30 Leah, 13:3015:00 Erik
Wed: 9:0011:00 Ola, 14:0016:00 Mohammad
Thu: 12:3013:30 Ola, 13:3015:00 Erik
Fri: 14:0016:00 Mohammad
 We are also all available by appointment by email if these many hours do not work for you.
Student learning outcomes
Similar to ADA1, but at a higher level.
Assessment
 Quizzes will be due each Tuesday before class. Purpose: to assess reading and video comprehension and assure you’re prepared to actively participate in class activities with a minimal lecture. (About 12, 20% of the final grade, the lowest few are dropped.) Most weeks plan for 13 hours reading and video, 3060 minute quiz.
 Viewing quiz solutions after the due date in UNM Learn is not intuitive. Click on the “Begin” button (this is the nonintuitive part since you are not actually beginning the quiz), then click “View All Attempts” to see the scores. Finally, click “Calculated Grade” to see the feedback for each question of the quiz.
 Inclass assignments are due the following day (Wed) by 5 pm, submitted to UNM Learn. Purpose: to struggle and find success in class with the concepts and skills. (About 12, includes class participation, 20% of the final grade, the lowest few are dropped.) Plan to start and finish in class, sometimes 12 hours beyond class.
 Homework (HW) assignments are assigned each Thursday and due the following Thursday, submitted to UNM Learn. Purpose: to apply concepts and skills to your class poster project. (About 12, 40% of the final grade, the lowest few are dropped.) Most weeks plan on 212 hours per assignment.
 Poster will be developed and completed in the last weeks of the semester, and the last week we’ll have poster presentations. Purpose: to have an overarching set of questions to answer using methods learned in the course, with a deliverable you can be proud of! (16% total: 1 poster and presentation, 2% preparation, 10% poster, 2% presentation, and 2% evaluations of others of the final grade.) In the last couple of weeks, assembling this poster may take 35 hours, using a template provided to you.
 Course surveys are to collect information to help facilitate the class or to encourage participation in course evaluations. Purpose: to participate in national projectbased learning projects and improve the course. (About 2, 4% of final grade [and a simple way to go from B+ to A].)
The final grade may include a small buffer at the discretion of the instructor. For example, the final grade could be the total points earned divided by the total possible points times 0.95 for graduate students and 0.90 for undergraduate students. That is [Final Grade] = [Points Earned]/[Points possible * 0.95] so that your grade is slightly higher than you earned.
Student Attendance: If a student has more than 3 absences, I reserve the right to assign to that student a WF and drop midsemester or assign an F at the end of the semester without warning. Students in this situation need to speak with Erik immediately.
Late assignments will not be accepted.
Collaboration and citation
For homework, I encourage you to work together. Please discuss the data, code, and problems with one another, but do your own exploration and write up. We expect everyone to hand in substantially different homework, and we will enforce this under the honor code. The small benefit you might get from plagiarism is not worth the severe penalty (of lost trust, being reported to the dean, no points for the assignment, etc.).
As in life, please use any resources available to you. Projects and some homework will explicitly encourage you to use resources on the internet, but showing extra initiative will always be appreciated. You may find R programming tough at first, so feel free to discuss your problems with other classmates or meet with or email questions to the TAs or me.
I encourage you to use the ideas of others, but make them your own, giving credit. For projects have a formal bibliography, for homework cite casually, and for code simply copy the URL into your code as a comment (which is doubly helpful to you for finding the resource again).
Statements
Disability statement
If you have a documented disability that will impact your work in this class, please contact me to discuss your needs. You’ll also need to register with the Accessibility Resource Center in 2021 Mesa Vista Hall (building 56) across the courtyard east from the SUB.
Title IX statement
In an effort to meet obligations under Title IX, UNM faculty, Teaching Assistants, and Graduate Assistants are considered “responsible employees” by the Department of Education (see pg 15). This designation requires that any report of gender discrimination which includes sexual harassment, sexual misconduct and sexual violence made to a faculty member, TA, or GA must be reported to the Title IX Coordinator at the Office of Equal Opportunity. For more information on the campus policy regarding sexual misconduct.
UNM Indigenous Peoples Land and Territory Acknowledgment
I would like to acknowledge the original peoples of this land. The Sandia Pueblo (other pueblo communities) and the Navajo nation have ties and stories on this land and within the broader community that are connected within New Mexico. I am grateful to be able to work here in relationship and strengthen community on this territory.
Our Classroom
We’re doing this because:
 We want you to be empowered with statistics.
 We believe everyone should get out of this course with awesome skills
 Realtime feedback promotes efficient learning
“It encourages me to engage actively with the course material and take responsibility for my learning.”
GAISE Connections
Our six recommendations include the following:
 Emphasize statistical literacy and develop statistical thinking
 Use real data
 Stress conceptual understanding, rather than mere knowledge of procedures
 Foster active learning in the classroom
 Use technology for developing conceptual understanding and analyzing data
 Use assessments to improve and evaluate student learning
Learning without thought is labor lost.
What I hear, I forget.
What I see, I remember.
What I do, I understand.
– Confucius
Archive
Passion Driven Statistics (PDS) data
Install PDS package.
AddHealthW1 Sampling Design, Codebook, RData.
AddHealthW4 Sampling Design, Codebook, RData.
NESARC Sampling Design, Codebook, RData.
OutlookOnLife Sampling Design, Codebook, RData.
GapMinder Sampling Design, Codebook, RData.
Old news
Step 0
Before our first class (Tue 1/21) please read through the following actions and install the required software on your computer and complete the brief survey. If you don’t have a computer, there are classroom computers which will be available only when the classroom is open. Video for this process (ignore the “crowdgrader” portion).
 Complete surveys
 a short Opinio presurvey required for classroom assessment (1/20 – 2/1/2020).
 Install R (windows or mac) or upgrade, then Rstudio. Videos that may be helpful:
 Install R on Mac (2 min).
 Install R for Windows (3 min).
 Install R and RStudio on Windows (5 min).
 Install R packages,
 Run RStudio
 Run code in R packages.
 Update all packages, RStudio Packages tab, click “update”, click “select all”, and “Install Updates”. Say “Yes” to restart R, but if it asks a second time, say “No”. Say “No” to “install from sources” if it asks.
 Set up your computer
 RStudio disable notebook
 Operating system to be more friendly to programming.
 (Postpone until later: Install LaTeX (for poster at end of the semester).)
RMarkdown and knitr issues
R errors, unresolved, and out of time
If you’re saying: “An error while knitting keeps me from turning in the assignment…”, then use code chunk option
```{r, error = TRUE}
to ignore the error and continue. This will allow you to turn in partial assignments with errors.
Precourse todos
Did you receive a registration error for Fall 2019? Send me an email with the following answers:
1. What registration error did you get (copy/paste is best)?
2. What is your UNM ID?
3. What is your Math/Stat background (that is, do you have the prerequisites)?
If you are waitlisted, as long as there are seats available I will override you into the course. Don’t worry.
3/1/17 – Data resources for poster:
List of 50+
kaggle
drivendata
538
agridat package
wise data sources
statsci datasets
vanderbilt datasets
Citing and using notes, including previous editions
Citing lecture notes: Erhardt EB, Bedrick EJ, and Schrader RM. (2020) Lecture notes for Advanced Data Analysis 2. Retrieved Mar 1, 2020, from statacumen.com/teach/ADA2/notes/ADA2_notes_S20.pdf, 136–144.
Notes from Spring 2020 using R with tidyverse: ADA2_notes_S20.pdf includes all chapters in one document.
Lecture notes for Advanced Data Analysis 2 (ADA2) Stat 428/528 University of New Mexico is licensed under a Creative Commons AttributionNonCommercialShareAlike 3.0 Unported License. Based on a work at https://statacumen.com/teach/ADA2/notes/ADA2_notes_S20.pdf.
Notes from Spring 2017 using R: ADA2_notes_S17.pdf
Notes from Spring 2016 using R: ADA2_notes_S16.pdf
Notes from Spring 2015 using R: ADA2_notes_S15.pdf
Notes from Spring 2014 using R: ADA2_notes_S14.pdf
Notes from Spring 2013 using R: ADA2_notes_S13.pdf
Notes from Spring 2012 using SAS: ADA2_notes_S12.pdf