2.1 )Exploratory Data Analysis for Univariate Quantitative Data
Data Cleaning and Survey Data Preparation
Data cleaning is the critical first step before conducting any statistical analysis.
Examples of data issues identified in raw student survey data ( total initial responses gathered):
Missing values: Respondents failed to complete all survey questions (missing observations were dropped).
Logical ambiguities: Responses indicating semesters until graduation (e.g., whether students counted spring and summer terms).
Impossible physical measurements: Heights reported as (filtered out; only heights satisfying were retained).
Excessive course loads: Enrollment reported as (filtered out; only credit loads satisfying were retained).
Implausible age entries: Claims of being when discovering Santa Claus isn't real.
Outrageous tuition costs: Semester tuition reported as .
Unrealistic weekly commitments: Homework time reported as .
Factually incorrect historical dates: Claims that the internet was invented in the year .
Incorrect university founding dates: Year Brigham Young University was established entered as or .
Data entry scale mismatches: Desired salary entered as (intended to represent ).
Summary of dataset cleaning outcomes:
Initial total responses:
Discarded responses: (thrown out due to incomplete or impossible answers)
Cleaned sample size (): individuals
Total variables recorded: variables
Clean dataset variables include:
SemestersTillGrad,AttendDevos,InRelationship,UsedDatingApp,AppleOrAndroid.Sample cleaned response records:
Individual 1: semesters till graduation,
Nodevotionals,Norelationship,Nodating app,AppleIndividual 2: semesters till graduation,
Yesdevotionals,Yesrelationship,Nodating app,AppleIndividual 3: semesters till graduation,
Yesdevotionals,Norelationship,Nodating app,Apple
The Framework of Statistical Analysis
The formal four-step process of statistical analysis consists of:
Identify the target population and parameter of interest.
Collect sample data from the population.
Posit a statistical model based on information contained in the sample.
Draw inference about the target population using the statistical model.
Univariate Research Objectives and Variable Types
Specific Study Setup and Research Questions:
Research Question: What is the average age at which BYU students find out Santa Claus isn't real? Specifically, is the mean age at which BYU students discover Santa Claus isn't real greater than ?
Target Population: All Brigham Young University students.
Population Parameter: The mean age at which all BYU students find out Santa Claus isn't real, denoted by the Greek letter (pronounced "mew").
Sample: A convenience sample of BYU students enrolled in Stat 121 who completed the online student survey.
Variable Definitions and Classifications:
Response Variable (): The age at which a student discovered Santa Claus isn't real.
Continuous Quantitative Variable: A numeric variable that can take any value within a range, including fractions and decimals (e.g., age at discovery ).
Discrete Quantitative Variable: A numeric variable that can only take values from a fixed set of countable numbers (e.g., number of bedrooms in a house).
Categorical Variable: A non-numeric variable that places an observation into one of a fixed set of categories (e.g., college of major, device brand like Apple or Android).
Explanatory Variable (): None for univariate quantitative exploratory data analysis.
Exploratory Data Analysis (EDA) Overview
Exploratory Data Analysis (EDA) is the foundational first step of any statistical analysis, using sample data to understand the broader population.
Primary Methods: Understanding data through graphical visual representations (pictures) and numerical summaries.
Essential Core Concept - Distribution: The distribution of a variable defines what values the variable can take and how frequently it takes those values.
Graphical EDA: Histograms
Step-by-Step Procedure to Construct a Histogram:
Divide the continuous range of numerical data into bins (number ranges, e.g., , , ).
Count the number of data observations falling inside each bin.
Plot the numerical bin ranges along the horizontal x-axis and the counts along the vertical y-axis.

Describing Histograms: Every histogram must be comprehensively evaluated using three fundamental features:
Shape: The visual geometry of the distribution curve.
Normal: Symmetric and bell-shaped with a single central peak.
Left Skewed: The tail of the distribution extends toward smaller/lower values on the left.
Right Skewed: The tail of the distribution extends toward larger/higher values on the right.
Uniform: The distribution is flat, with equal frequencies across all bin ranges.
Bimodal: The distribution displays two prominent distinct peaks.
Center: The middle point of the data distribution.
Spread: The range or variability spanning from the smallest to the largest observed value.



Critical Limitation of Histograms:
Visual representation depends heavily on the chosen bin size and number of bins.
Changing bin resolution (e.g., bins vs. bins vs. bins) alters the perceived shape and level of detail.

Graphical EDA: Density Plots
Definition: A density plot is a smoothed, continuous mathematical estimation of a histogram.
Fundamental Mathematical Principle: The total area under any density curve is equal to .

Software Tooling for Exploratory Data Analysis
Navigation in the Stat 121 Analysis Tool (
rconnect.byu.edu/Stat121V2):Step 1: Select Dataset under "1) Dataset Selection" (e.g., pre-existing dataset
401K Returnswith sample size , or upload a custom file).Step 2: Select Variable under "2) Select Variable" (e.g.,
YearorAgeSantaClaus).Step 3: Select Plot under "3) Graphical Exploratory Data Analysis" (choose desired plot type).

Step 4: Calculate numerical metrics under "4) Numerical Exploratory Data Analysis" by selecting summary statistics from the dropdown menu.

Numerical EDA: Measures of Center
Sample Mean ():
Represents the traditional numerical average and acts as the physical balancing point of the histogram.
Mathematical Formula:
Sample Median ():
The exact middle data value when observations are sorted in order.
Cuts the distribution exactly in half ( of observations lie below and lie above ).
Mode:
The most frequently occurring individual data value, corresponding to the highest peak of the density curve.
Sample Numerical Values for
AgeSantaClausDataset:Sample Mean:
Median:
Mode:

Distinction Between Sample Statistics and Population Parameters
Key Conceptual Relationship:
A sample statistic (such as sample mean ) is computed directly from sample data.
A population parameter (such as population mean ) is a fixed, generally unknown theoretical value describing the whole population.
Inequality Principle:
Analytical Implications: Observing a sample mean does not eliminate the need for further analysis. Sample statistics vary from sample to sample, requiring formal statistical inference to determine whether for the population.
Numerical EDA: The Five-Number Summary and Percentiles
Components of the Five-Number Summary:
Minimum (): The smallest individual value in the sample dataset.
First Quartile (): The percentile ( of sample data falls below this value).
Second Quartile (): The median or percentile ( of sample data falls below this value).
Third Quartile (): The percentile ( of sample data falls below this value).
Maximum (): The largest individual value in the sample dataset.
Definition of Percentile: The specific numerical value such that of the data observations fall strictly below it.
Graphical EDA: Boxplots
Definition: A boxplot is a direct visual display of the five-number summary.
Visual Structure:
Central box spans from to (representing the middle of observations).
A solid vertical line inside the box marks the median ().
Whiskers extend outwards from the box to the minimum and maximum non-outlier values.

Numerical EDA: Measures of Spread
Standard Deviation ():
Conceptually measures the average distance of individual observations from the sample mean .
Mathematical Formula:
Interquartile Range ():
Measures the total spread of the middle of data observations.
Mathematical Formula:
Range:
Measures the absolute distance between extreme observations.
Mathematical Formula:
Calculated Spread Metrics for
AgeSantaClausDataset:Standard Deviation:
Interquartile Range:
Range:

Properties of Measures of Spread
Non-negativity Rule: Standard deviation (), Range, and Interquartile Range () are strictly non-negative:
Zero Variability Rule: If or , every single observation in the dataset holds the exact same numerical value.
Dimensional Units Rule: Standard deviation (), Range, and Interquartile Range () always retain the exact same physical measurement units as the original raw data.
Numerical EDA: Measures of Shape and Skewness
Numerical Domain of Skewness: Skewness values range continuously from negative infinity to positive infinity:
Directional Interpretation:
If : The distribution is left-skewed.
If : The distribution is right-skewed.
Normality Threshold Rule of Thumb: If skewness satisfies the inequality:
the distribution is classified as close enough to normal or symmetric.

Impact of Distribution Shape on Center and Spread
Influence of Skewness and Outliers:
The sample mean is pulled strongly toward the long tail of a skewed distribution.
Standard deviation inflates when extreme values or long tails are present.
Median and remain resistant to skewness and extreme values.
Positional Hierarchy of Center Measures across Distribution Shapes:
Right-Skewed Distribution:
Symmetric Distribution:
Left-Skewed Distribution:

Outlier Detection and the 1.5 IQR Rule
Outlier Definition: An observation that lies an extreme distance away from the primary cluster of data.
The Outlier Flagging Rule: An observation is formally classified as an outlier if it satisfies either inequality condition:
Representation on Boxplots: Flagged outliers are drawn as individual isolated points beyond the boxplot whiskers.
Rules of Thumb for Selecting Summary Statistics
Case 1: Skewed Distributions or Datasets with Numerous Outliers:
Report Median for measure of center.
Report Interquartile Range () for measure of spread.
Case 2: Approximately Normal / Symmetric Distributions without Major Outliers:
Report Mean () for measure of center.
Report Standard Deviation () for measure of spread.
Applied Homework Options and Key Vocabulary
Unit 2 Homework Options:
401(k) Returns
Calories in Cereal
Sunshine Duration
Key Terminology List:
Continuous quantitative variable
Discrete quantitative variable
Exploratory data analysis (EDA)
Distribution of a variable
Histograms
Density plots
Shapes (Normal, Left Skewed, Right Skewed, Uniform, Bimodal)
Measures of center (Mean, Median, Mode)
Measures of spread (Standard deviation, Interquartile Range, Range)
Measures of shape (Skewness)
Outliers and outlier inflation effects
Rule for detecting outliers