Datafication, Exploratory Data Analysis, and Classification Models Study Guide
Course Overview, Logistics, and Learning Environment
Course Schedule and Structure:
Lectures run for hours per week with a -minute mid-lecture break (typically taken around to minutes prior to the second hour).
Module encompasses the first weeks of the semester and covers all content evaluated on the midterm test.
Lecture design focuses on active, real-time student engagement rather than passive slide reading.
Engagement and Stats Apps:
Accessible on Canvas via the left-hand navigation menu under "Stats Apps" (toggle the menu display if hidden on mobile or small screens).
Allows anonymous live student input while attributing entries to Canvas profiles to record engagement marks.
Grace Period: Prep work contributions submitted up until Monday morning at receive engagement credit, though completion prior to lectures is strongly recommended.
Communication Protocols and Staff Access:
Instructor Office: Room , Building .
Help Center / Drop-in Location: Room , Building (fully refurbished).
Drop-in Hours: Available for hour directly following lectures, Fridays all afternoon, and Mondays from to .
Email Policy: Direct email is mandatory for contacting staff (addresses listed on the "Meet the Team" Canvas page). Canvas direct messaging must not be used due to lost messages.
Ed Discussion: Online platform on Canvas for course-related queries. Existing threads must be searched before creating new posts.
Classroom Conduct: In-class chatter is prohibited due to hall acoustics that carry background voice audio across the room.
Course Assessments:
Quizzes: Located under the "Quizzes" tab on Canvas. Unlimited submission attempts are permitted prior to the deadline. Due every Friday at end of day (late penalties apply thereafter).
Weekly Tasks: Located in the course book under each chapter. Due every Monday at . Tasks utilize unique individualized datasets; final responses must be downloaded as an HTML document and uploaded to Canvas under "Assignments" -> "Task 1".
Open Resource Policy: Prep work course notes and personal study guides may be brought directly into tests and examinations.
Class Representative Application Requirements:
Duties: Attend mandatory meeting times during the semester and gather student feedback.
Application Format: Send an email to the instructor containing exactly sentences ( sentence detailing motivation for the role, sentence describing field of study and background).
Deadline: End of business on Friday.
Technical Requirements and Course Tools:
Recommended Browser: Google Chrome is strongly advised (especially on macOS/Apple devices) for optimal compatibility with course web apps and scripts.
Insight Lite: Web application located under "Tools" in the course book, used for statistical data visualization, data import, and numerical analysis.
Panopto Video: Canvas folder housing all recorded lecture videos.
Software Guides: Available in the course book covering functions for Google Sheets and Insight Lite.
Datafication and Variables in Statistics
Concept of Datafication:
Datafication is the algorithmic process of transforming raw unstructured data or existing variables into structured quantitative or categorical variables using formulas or code.
Examples include converting raw unstructured text strings into explicit character counts, word counts, or logical indicators.
Sentiment Analysis:
Sentiment analysis converts qualitative text into measurable categories reflecting emotional tone (e.g., positive, negative, neutral).
Practical Applications: Used in social media monitoring, such as tracking consumer sentiment on Twitter following product releases (e.g., evaluating reactions to a novel licorice chocolate mango ice cream flavor).
Dictionary-Based Sentiment Analysis: Uses pre-defined word libraries to classify text based on target vocabulary (e.g., mapping "nervous" to negative sentiment or "excited" to positive sentiment).
Structure of a Rectangular Data Set:
A rectangular data set is organized such that every column represents a variable and every row (excluding header row ) represents an individual case or entity.
Variable Types in Data Collection Spreadsheets:
timestamp: Date and time of submission.writing ID: Unique cryptographic hash assigned to the entry.device type: Categorical variable indicating hardware type (e.g., desktop/laptop vs. mobile).screen width: Numeric variable recording screen resolution in pixels.comment: Raw unstructured text string.time taken in seconds: Continuous numeric variable representing completion duration.user ID: Unique Canvas profile identifier mapped for engagement credit.
Classification of Variables:
Categorical Variable: Takes discrete non-numeric values, labels, or factor levels (e.g., device type, sentiment category, prior statistics experience level).
Numeric Variable: Takes continuous or discrete numerical values representing direct counts or measurements (e.g., screen width in pixels, completion duration in seconds, character count).
Google Sheets Operations and Data Tidying
Crowdsourcing Data Cleansing:
Datasets containing raw text inputs require manual crowdsourced auditing to systematically convert free-form comments into standardized categorical data.
A random number generator selects specific row indices between row and the maximum dataset row (e.g., row ) to distribute auditing across reviewers.
Google Sheets Functions and Formulas:
Column Insertion: Right-click the header of an adjacent column (e.g., column
H) and select "Insert 1 column to the left".Character Length Calculation:
Function syntax:
Example: calculates the total number of characters contained in cell .
Duplicate Removal:
Path:
Data->Data cleanup->Remove duplicates.Select target unique identifier columns (e.g., submission ID or comment row) to eliminate double submissions.
Publishing Spreadsheets for Insight Lite Integration:
Path:
File->Share->Publish to web.Sheet Selection: Select the specific named worksheet tab.
File Format: Set output drop-down to "Comma-separated values (.csv)".
Link Verification: Ensure the generated URL ends explicitly with the
.csvextension to guarantee readability by Insight Lite.
Exploratory Data Analysis Using Insight Lite
Data Import Procedure in Insight Lite:
Open Insight Lite via course book tools.
Path:
File->Import dataset-> Paste published.csvURL -> ClickImport-> ClickConfirm.Select
Visualizetab to initialize graphical exploration.
Variable Classifications in Bivariate Analysis:
Response Variable: The primary outcome variable being analyzed or predicted. Selected as Variable in Insight Lite and plotted on the primary vertical axis.
Explanatory Variable: The secondary variable used to explain variations or structural differences in the response variable. Selected as Variable in Insight Lite.
Terminology Standard: Replaces legacy scientific terms such as "dependent variable" (response variable) and "independent variable" (explanatory variable).
Analysis of Student Course Sentiment:
Overall Sentiment Distribution:
Positive Sentiment: Represented the statistical majority at .
Neutral and Negative Sentiment: Accounted for the remaining combined.
Sentiment Segmented by Prior Statistics Background:
Year Statistics Background: of students with Year high school statistics experience expressed a positive sentiment toward the course.
Less Prior Statistics Background: Approximately to of students with less prior statistics experience expressed positive sentiment.
Neutral Sentiment: Exhibited minimal variation between students with Year background and those with less background.
Evaluative Standards: Statistical evaluations must rely strictly on quantitative empirical data (e.g., percentages, proportions, counts) rather than anecdotal or contextual assumptions.
Classification Models, Baseline Models, and Spam Detection
Terminology in Text Classification:
Spam: Unsolicited, unwanted automated messages or promotional communications.
Ham: Legitimate, essential text messages from personal, academic, or professional contacts.
The Baseline Model Concept:
Definition: A baseline model is a naive classification benchmark that operates without incorporating any explanatory variables, predicting the overall majority class for every instance.
Baseline Performance: In a dataset where of total messages are ham, predicting "ham" for all incoming messages yields a baseline accuracy of .
Purpose: Serves as the baseline threshold that any feature-driven predictive model must exceed to demonstrate predictive utility.
Feature Engineering for Text Classification:
Categorical variables engineered from message text must feature clear, descriptive names and precise, unambiguous level definitions:
contains_numbers: Levels =contains numbersvs.no numbers.contains_exclamation: Levels =contains exclamationvs.no exclamation.contains_free_or_urgent: Levels =contains free/urgentvs.does not contain.character_length_group: Levels =less than 100 charactersvs.at least 100 characters.contains_url: Levels =contains URLvs.no URL.
Graphical Evaluation of Explanatory Power in Mosaic Plots:
Bar Width: Represents the sample size / proportion of observations belonging to that category level of the explanatory variable.
Bar Height: Displays the relative proportion of response variable categories (spam vs. ham) within that specific explanatory level.
Criterion for Superior Predictors: Optimal explanatory variables produce maximum vertical contrast across levels (e.g., one level showing a high percentage of spam and another showing a high percentage of ham).
Comparative Evaluation of Candidates:
contains_url: Ineffective predictor; very few text messages contain URLs, yielding minimal overall predictive separation.contains_free_or_urgent: Strong positive identifier ( spam when present), but weak negative identifier when absent ( ham, spam).contains_numbers: Highly effective dual-level predictor. (up to in sub-samples) of messages containing numbers were spam, while (up to ham in contrast tests) of messages lacking numbers were ham.
Confusion Matrices and Model Evaluation Metrics
Structure of a Confusion Matrix:
A confusion matrix is a tabular grid displaying cross-tabulated counts of predicted classifications versus actual ground-truth classes.
Grid Components:
True Spam (Predicted Spam, Actual Spam)
False Spam / False Positive (Predicted Spam, Actual Ham)
False Ham / False Negative (Predicted Ham, Actual Spam)
True Ham (Predicted Ham, Actual Ham)
Formula for Percentage Classified Correctly (PCC):
PCC measures total classification accuracy of a model as a percentage:
Sample Calculation from Class Exercise:
Decision Rule: Predict "Spam" if the message contains numbers; predict "Ham" if the message contains no numbers.
Evaluated Sample Size: text messages.
Correct Predictions: out of messages correctly identified ( True Ham + True Spam).
Computation:
Model Performance Assessment: The feature-driven decision rule model () significantly outperforms the naive baseline model (), establishing strong predictive value.