QM Basic textbook 2026-2027
Table of contents
- Welcome and how to use this book
- QM Basic: Course overview
- Lecture 1: Introduction to data analysis
- Lecture 2: Probability foundations and random variables
- Lecture 3: Discrete distributions, expectation, and variance
- Tutorial 1: Evidence and probability foundations
- Lecture 4: Conditioning, Bayes’ rule, and independence
- Lecture 5: Joint random variables, covariance, and correlation
- Lecture 6: Continuous distributions and the normal model
- Tutorial 2: Conditioning, relationships, and the normal model
- Lecture 7: Samples, parameters, and estimators
- Lecture 8: Sampling distributions, the central limit theorem, and the t distribution
- Lecture 9: Confidence intervals
- Tutorial 3: Sampling and confidence intervals
- Lecture 10: Testing decisions, errors, and power
- Tutorial 4: Hypothesis tests, errors, and power
- QM Basic Mock Exam
- How to succeed in this course
- R Refresher
- Mathematics Refresher
1. Welcome and how to use this book
1.1 Welcome to Quantitative Methods to Understand E&BI
Welcome to the Quantitative Methods to Understand E&BI learning line. This program spans three courses designed to equip you with the skills to transform questions about entrepreneurship, organizations, markets, and innovation into defensible quantitative evidence.
The program aims to enhance your ability to comprehend research papers, conduct quantitative theses, and perform careful data analysis in professional settings. Beyond formulas and R commands, you will develop the critical skills to read and produce evidence with integrity, including selecting appropriate methods, explaining their underlying logic, interpreting results accurately, and recognizing the limitations of available data 3.
1.2 Meet your teachers
The learning line is taught by three lecturers, each accessible via email and university profiles. Dr. Valentina Melentyeva teaches QM Basic and QM Intermediate.
Dr. Gabriela Miyazato Szini teaches QM Basic. Dr. Serhan Sadikoglu teaches QM Advanced 3 4.
1.3 Why this matters if you want to start a business
Founders constantly make decisions regarding products, pricing, customer targeting, and investment. Evidence-based decision-making, facilitated by readily available data and tools like R or AI assistants, significantly improves these choices.
While obtaining numbers is straightforward, understanding their meaning, reliability, and implications is the challenging part. AI assistants can provide outputs like averages or p-values, but their interpretations may sometimes be incorrect.
This learning line empowers you to critically evaluate such outputs, verify them, and translate them into actionable decisions. Each lecture begins with a practical question, uses data to explore it, and then introduces the necessary theory for interpreting the analysis results, thereby clarifying what R or AI assistants communicate.
These skills are also vital for venture projects, academic research, and thesis work. The three courses are interconnected, with QM Intermediate and QM Advanced building upon the foundational concepts of QM Basic 4.
1.4 Course structure and learning outcomes
The learning line consists of three courses:
- QM Basic: Offered in the 1st Semester, it includes 10 lectures and 4 tutorials, covering introduction to data analysis, probability theory, and statistics.
- QM Intermediate: Offered in the 3rd Semester, it comprises 6 lectures and 2 tutorials, focusing on linear regression analysis.
- QM Advanced: Offered in the 4th Semester, it delves into advanced data analysis methods with textbook chapters currently in progress.
Upon completion of the learning line, you will be able to:
- Translate E&BI questions into variables, comparisons, and testable claims.
- Work reproducibly with data in R and effectively communicate the meaning of the output.
- Conduct high-quality data analysis for both professional and research purposes.
- Evaluate the strengths and limitations of evidence presented in research papers.
- Design and complete a quantitative thesis 5.
1.5 How to use this book
The book is organized into QM Basic, QM Intermediate, QM Advanced, and Supplementary resources, accessible via a permanent menu. For optimal viewing of wide formulas and tables, a laptop or tablet is recommended.
Within each course, follow the chapters sequentially.
- Lecture chapters: Introduce a question and a dataset, teaching data analysis in R alongside the theory needed for interpretation.
- Tutorial chapters: Reinforce learning through guided practice, helping you recall, combine, and apply concepts to prepare for exams.
- Course exam resources: Include a cumulative formula sheet for QM Basic, a code sheet for QM Intermediate, and mock exams for both courses.
Supplementary resources offer general assistance with R and mathematics, including printable weekly checklists on the "How to succeed in this course" page 5.
1.6 Lecture chapter structure
Each lecture chapter is divided into three parts:
- Before class: Involves short preparation tasks, typically including a video, a warm-up exercise, and a prediction.
- Lecture material: Contains the full content of the lecture, covering the question, data, R code, theory, and worked examples. The text provides step-by-step instructions for self-paced review and re-watching videos.
- After class: Offers practice exercises with model answers, starting with a full review of the lecture material, followed by recall questions and tasks.
Several types of boxes are used throughout the chapters:
- Definition boxes: Contain core terms.
- Optional boxes (grey): Hold formal versions, derivations, and supplementary topics not essential for the exam.
- Try it boxes: Prompt you to attempt a step before revealing the answer.
- A founder’s decision: Illustrates how the lecture's method aids in a specific decision for an invented venture.
- What … can and cannot … boxes: Detail the limitations of results, such as what a correlation can or cannot state.
- Check the AI boxes: Present AI-generated answers with errors for you to identify and correct.
- Steps for a complete answer boxes: Outline the components of a complete written answer, such as the five steps of a hypothesis test 6.
📝 A "founder's decision" box illustrates how a lecture's method aids a specific decision for an invented venture.
1.7 Lecture preparation and external videos
Many "Before class" sections feature a "Video preparation" box. Watching these videos and taking notes on the specified concepts is recommended.
Some videos provide start and end times for focused viewing. QM Basic utilizes videos from MIT OpenCourseWare, jbstatistics, and Brandon Foltz, while QM Intermediate uses Brandon Foltz’s Statistics 101 series.
Collapsed notes may indicate differences between video content and this textbook. External explanations are also linked within theory sections and can be revisited after lectures or if a lecture was missed.
Note that external sources may use different notation or cover more material; always adhere to the notation and scope presented in this textbook 6 7.
1.8 R and main dataset
R is used throughout all three courses. If you need a refresher on R commands or workflows, consult the R Refresher section or your previous programming course.
The primary dataset for this learning line comprises pitches from the US television program Shark Tank. This dataset, a teaching version of Satya Thirumani’s Shark Tank US Dataset, contains 1,441 pitches from seasons 1 to 16. Each row represents a recorded pitch, including variables such as pitch identifiers, episode details, venture industry, description, requested amount and equity, deal announcement status, deal terms, and presenter gender.
The file, shark_tank_teaching.csv, can be downloaded directly. Examples and tasks using this dataset are marked with the "Shark Tank data" tag 7.
1.9 Tutorials and assessment
QM Basic and QM Intermediate conclude with a written exam that accounts for 100% of the final grade. For QM Intermediate, the exam is administered in TestVision, with R available during the assessment.
Tutorials in all courses are designed to prepare you for these exams. Key exam preparation resources include the QM Basic Formula Sheet, QM Basic Mock Exam, QM Intermediate Code Sheet, and QM Intermediate Mock Exam 7.
1.10 Working with AI
Each course features a dedicated AI assistant, a Tilly bot, accessible via links on the respective course overview pages. When using AI, follow the "Attempt, Ask, Verify, Explain" steps:
- Attempt: Solve the problem yourself first and identify your sticking points.
- Ask: Prompt the AI for a hint, a counterexample, or a question to help pinpoint your mistake. Precise prompts yield better results.
- Verify: Cross-check the AI's response against the data, course notation, and R output. This verification step is crucial.
- Explain: Articulate the result in your own words to ensure genuine understanding. Seek AI feedback on your explanation or bring it to lectures, tutorials, or classmates for discussion 7 8.
2. QM Basic: Course overview
2.1 Course objectives
By the end of QM Basic, students will be able to:
- Identify observational units, variables, samples, populations, and the limitations imposed by data selection methods.
- Summarize and visualize numerical and categorical data using R.
- Work with events, random variables, distributions, expectation, variance, covariance, and correlation.
- Update probabilities with new information using conditioning and Bayes' rule.
- Apply uniform, normal, and t models, and verify the conditions for their use.
- Explain sampling variability, standard errors, confidence intervals, and two-sided tests of a claimed value.
- Interpret R output, including units, uncertainty, scope, and causal limitations 9.
2.2 Course sequence 10
The course progresses through several main topics, building foundational knowledge in data analysis and probability.
| Chapter | Main focus |
|---|---|
| Lecture 1 | Introduction to data analysis |
| Lecture 2 | Probability foundations and random variables |
| Lecture 3 | Discrete distributions, expectation, and variance |
| Tutorial 1 | Evidence and probability foundations (Lectures 1 to 3) |
| Lecture 4 | Conditioning, Bayes’ rule, and independence |
| Lecture 5 | Joint random variables, covariance, and correlation |
| Lecture 6 | Continuous distributions and the normal model |
| Tutorial 2 | Conditioning, relationships, and the normal model (Lectures 4 to 6) |
| Lecture 7 | Samples, parameters, and estimators |
| Lecture 8 | Sampling distributions, the central limit theorem, and the t distribution |
| Lecture 9 | Confidence intervals |
| Tutorial 3 | Sampling and confidence intervals (Lectures 7 to 9) |
| Lecture 10 | Testing decisions, errors, and power |
| Tutorial 4 | Hypothesis tests, errors, and power (Lecture 10) |
2.3 Weekly rhythm and assessment
The course follows a consistent weekly structure: preparation before class, active participation during class, and review and practice after class. Four tutorials are designed to aid exam preparation through guided practice, utilizing the cumulative QM Basic Formula Sheet.
The final exam is closed-book, with necessary values provided in the task or on the formula sheet. A mock exam is available to simulate the exam format and question types 10.
2.4 Tilly, the course AI assistant
Tilly is the dedicated AI chatbot for QM Basic, available to answer organizational questions regarding the schedule or grading. It also serves as a personal tutor for task completion and can generate additional practice questions.
Students should follow the "Attempt, Ask, Verify, Explain" steps when using Tilly 11.
📝 Tilly can answer questions like "What is the schedule for Lecture 5?" or "Can you give me more practice problems on Bayes' rule?"
3. Lecture 1: Introduction to data analysis
3.1 Organizing a reproducible R analysis
A reproducible R analysis ensures that the entire analytical process can be recreated from start to finish, without relying on previously executed commands in the R Console. This involves setting up a structured project environment and writing all steps in scripts.
- Project setup:
- Create a main course folder (e.g.,
qm-basic). - Inside, create subfolders for
dataandscripts. - Open RStudio using
File > New Project > Existing Directoryand select the course folder. This sets the working directory and allows for relative path usage. - Data handling:
- Download data files (e.g.,
shark_tank_teaching.csv) and place them in thedatasubfolder. - Keep downloaded data files unchanged.
- Use relative paths (e.g.,
data/shark_tank_teaching.csv) to reference files within the project. - Scripting habits:
- Write every step of the analysis (importing, checking, transforming, plotting, modeling) in R scripts.
- Assign meaningful names to R objects (variables, functions).
- Add comments (
#) below code to explain the meaning of the results. - Before sharing an analysis, restart R and run the complete script to ensure reproducibility 12 13.
3.2 The analysis cycle and AI assistance
Data analysis follows a structured cycle, often involving iteration between steps. When using AI assistants for code or interpretation, a verification process is crucial due to their probabilistic nature.
The data analysis cycle involves six steps:
- Ask a focused question: Clearly define what you want to investigate.
- Define the unit and measurement: Determine what each row represents and how to measure relevant characteristics.
- Obtain or create data: Collect or generate the data and document its source.
- Inspect and check data: Validate the data before performing calculations.
- Summarize and visualize patterns: Use tables and graphs to explore the data.
- Interpret results and state limits: Explain findings in context and acknowledge limitations.
When using an AI assistant, follow these four verification steps:
- Attempt: Try to solve the problem or write the code yourself first.
- Ask: Request hints, clarifying questions, counterexamples, or code reviews from the AI.
- Verify: Check every claim, calculation, and interpretation against the data, R output, course notation, and reliable sources.
- Explain: Rephrase the result in your own words and seek feedback on your explanation 14.
3.3 Variables in the Shark Tank file 15 16
The Shark Tank dataset contains information on televised pitches, with each row representing a single pitch and each column representing a specific variable. Understanding the type of each variable is essential for appropriate analysis.
The Shark Tank file records 1,441 televised pitches, with each row representing one pitch and each of the 19 columns representing a variable 12 23.
| Variable | Meaning | Type |
|---|---|---|
| pitch_id | number that labels the row | identifier |
| startup_name | name of the venture or product | identifier (a name) |
| season | television season, 1 to 16 | numerical, discrete, ordered in time |
| episode | episode number within the season | numerical, discrete, ordered within the season |
| industry | industry category given by the source | categorical, nominal |
| business_description | short written description of the venture, written by the source of the data | text, not analysed in this course |
| description_words | number of words in business_description | numerical, discrete (a count) |
| pitcher_gender_group | all_women, all_men, mixed, or unknown, as classified by the source | categorical, nominal |
| women_represented | 1 for all_women or mixed, 0 for all_men, missing for unknown | categorical, nominal with two groups (binary), stored as 0/1 |
| multiple_entrepreneurs | 1 if more than one entrepreneur presented, 0 otherwise | categorical, nominal with two groups (binary), stored as 0/1, with missing values |
| ask_amount_usd | amount of money requested | numerical, continuous, in USD |
| equity_offered_pct | ownership share initially offered | numerical, continuous, in percent |
| requested_valuation_usd | company value implied by the request | numerical, continuous, in USD |
| deal_on_show | 1 for an on-air deal, 0 otherwise | categorical, nominal with two groups (binary), stored as 0/1 |
| deal_amount_usd | amount of money in the agreed deal | numerical, continuous, in USD, missing without a deal |
| deal_equity_pct | ownership share in the agreed deal | numerical, continuous, in percent, missing without a deal |
| deal_valuation_usd | company value implied by the agreed deal | numerical, continuous, in USD, missing without a deal |
| number_sharks_in_deal | number of sharks who joined the deal, 1 to 5 | numerical, discrete (a count), missing without a deal |
3.4 Types of variables
Variables are classified by their type, which dictates the appropriate methods for analysis, including the types of tables and graphs that can be used.
- Categorical variables: Values represent groups.
- Nominal: Groups have no inherent order (e.g.,
industry). A nominal variable with two groups is called binary (e.g.,deal_on_show, stored as 0/1). - Ordinal: Groups have an order, but the numerical distances between them are not meaningful (e.g., a stage of venture: idea, prototype, first sales).
- Numerical variables: Values are numbers that count or measure something.
- Discrete: Values are separate numbers, often counts (e.g.,
number_sharks_in_deal, or a rating scale from 1 to 5). Rating scales are treated as discrete numerical variables in this course. - Continuous: Values can lie anywhere within a given range (e.g.,
equity_offered_pct, or a probability from 0% to 100%). - Identifier variables: Values uniquely label a unit but have no analytical meaning (e.g.,
pitch_id) 19.
3.5 Sample and target population
Data analysis often involves studying a sample to make inferences about a larger population. It is crucial to distinguish between the observed sample and the broader target population, and to understand the sources of potential differences.
- Population: The complete set of units about which a question is asked.
- Sample: The subset of the population that is actually observed.
- Random sample: A sample where every unit in the population has an equal chance of being selected 20.
Sampling variability and selection bias are two key reasons why a sample might differ from its population:
- Sampling variability: This occurs by chance, even in a random sample, where the sample might contain an unusual number of certain characteristics. Larger random samples generally reduce this type of variation. Scenario 1 describes sampling variability where a random sample of students has an unusual number choosing "All-in.".
- Selection bias: This occurs when a sample systematically excludes certain individuals or groups, often because they are easier to reach. Collecting more data from the same biased group does not eliminate the bias. Scenario 2 illustrates selection bias, where a survey shared in an entrepreneurship club chat results in a biased sample of highly interested members 21.
3.6 Inspecting and validating the Shark Tank dataset 24
Before analysis, it is essential to inspect a dataset to understand its structure, identify missing values, and check for realistic data ranges.
The Shark Tank dataset includes 1,441 pitches across 16 seasons, with 19 variables. Missing values (NA) can occur for various reasons; for instance, deal-related variables are missing for pitches without a deal 23 24.
| Variable | Missing Values |
|---|---|
| pitch_id | 0 |
| startup_name | 0 |
| season | 0 |
| episode | 0 |
| industry | 0 |
| business_description | 0 |
| description_words | 0 |
| pitcher_gender_group | 0 |
| women_represented | 7 |
| multiple_entrepreneurs | 427 |
| pitcher_state | 0 |
| ask_amount_usd | 0 |
| equity_offered_pct | 0 |
| requested_valuation_usd | 0 |
| deal_on_show | 0 |
| deal_amount_usd | 559 |
| deal_equity_pct | 559 |
| deal_valuation_usd | 559 |
| number_sharks_in_deal | 559 |
The seasons range from 1 to 16. The multiple_entrepreneurs variable has missing values for 427 pitches, and women_represented has missing values for seven pitches where the gender classification was unknown 24 25.
3.7 Describing one variable 26
Describing a single variable involves understanding its empirical distribution using appropriate tables and graphs based on its type.
- Empirical distribution: How often each value or range of values occurs in a dataset.
- Frequency table: Counts the occurrences of each value for a categorical or discrete variable.
- Relative-frequency table: Shows the proportion (or percentage) of occurrences for each value.
- Bar chart: Used for categorical or discrete variables, with bar height representing the count or proportion of each category.
- Histogram: Used for numerical variables, grouping values into intervals and showing the count of observations within each interval 26 27.
The proportion of pitches that resulted in an on-air deal can be calculated as the mean of the deal_on_show variable (coded as 1 for a deal, 0 otherwise). In the Shark Tank dataset, 882 out of 1,441 recorded pitches (61.2%) reached an on-air deal 26.
| Statistic | Value |
|---|---|
| On-air deals | 882 |
| Recorded pitches | 1441 |
| Recorded deal rate | 0.6120749 |
3.8 Frequency tables and bar charts for discrete categories 27
Frequency tables and bar charts are used to visualize the distribution of categorical or discrete variables, showing the counts or proportions of each category.
The season variable, being discrete, can be summarized using frequency and relative-frequency tables. Seasons 1 to 3 have fewer pitches than an equal distribution, while seasons 4 to 13 have slightly more, and seasons 14 to 16 have slightly fewer 27.
| Season | Count | Proportion |
|---|---|---|
| 1 | 64 | 0.044 |
| 2 | 36 | 0.025 |
| 3 | 60 | 0.042 |
| 4 | 103 | 0.071 |
| 5 | 116 | 0.08 |
| 6 | 116 | 0.08 |
| 7 | 116 | 0.08 |
| 8 | 96 | 0.067 |
| 9 | 96 | 0.067 |
| 10 | 92 | 0.064 |
| 11 | 96 | 0.067 |
| 12 | 100 | 0.069 |
| 13 | 96 | 0.067 |
| 14 | 87 | 0.06 |
| 15 | 87 | 0.06 |
| 16 | 80 | 0.056 |
A bar chart visually represents these counts, with each bar's height corresponding to the number of pitches in that season 28.
3.9 Histograms for numerical variables
Histograms are used to visualize the distribution of numerical variables by grouping values into intervals and displaying the frequency of observations within each interval.
The histogram for equity_offered_pct shows that most initial offers are below 20%, with a long tail extending towards higher values, indicating a right-skewed distribution. The dashed line on the histogram marks the median, which is a typical value that is not unduly influenced by extreme values 28 29.
- Median: The middle value of an ordered dataset. At least half of the observations are at or below the median, and at least half are at or above it. For an even number of observations, it's the average of the two middle values 29.
📝 Five founders offer 10%, 5%, 25%, 8%, and 10%. Ordered: 5%, 8%, 10%, 10%, 25%. The median is the third value, 10% 29.
📝 Four founders offer 20%, 5%, 15%, and 8%. Ordered: 5%, 8%, 15%, 20%. The median is the average of the two middle values (8% and 15%), which is 11.5% 29.
The median for the equity offered in the Shark Tank dataset is 10%. This means that at least half of the founders offered 10% or less 30.
3.10 Reading a graph
Interpreting graphs involves a systematic five-step process to understand the data being presented and the patterns within it.
The five steps to read any graph are:
- Unit and variables: Identify what one observation represents and what is shown on each axis, including units.
- Scales: Examine the axis scales, noting their starting points, interval widths, and whether counts or proportions are displayed.
- One element: Describe a single bar, point, or line in a complete sentence.
- Pattern: Describe the overall shape of the distribution, including where most values lie, symmetry, skewness, and potential outliers.
- Limits: State what the graph cannot convey 30.
3.11 Measures of spread 31
Beyond the median, measures of spread like quartiles and the interquartile range provide further insight into the variability and distribution of numerical data.
- Lower quartile (Q1): At least one quarter of the observations are at or below this value, and at least three quarters are at or above it.
- Upper quartile (Q3): At least three quarters of the observations are at or below this value, and at least one quarter are at or above it.
- Interquartile range (IQR): The difference between the upper and lower quartiles (Q3−Q1), representing the width of the middle half of the data 30.
For the equity_offered_pct in the Shark Tank dataset:
| Statistic | Value |
|---|---|
| Lower quartile (25%) | 8% |
| Median (50%) | 10% |
| Upper quartile (75%) | 20% |
| Interquartile range (IQR) | 12 percentage points |
The middle half of the equity offers lies between 8% and 20% 31.
📝 Applying the five steps to Figure 1.2 (histogram of equity offered):
- Unit and variables: One observation is one recorded pitch. The horizontal axis is equity offered in percent; the vertical axis is the number of pitches.
- Scales: The horizontal axis runs from 0 to 100 in 5% intervals. The vertical axis shows the count of pitches.
- One element: The tallest bar covers 5% to 10% equity, representing 560 pitches.
- Pattern: The distribution is strongly right-skewed, with most offers below 20% and a few high values forming a thin tail.
- Limits: The histogram does not explain why offers cluster in certain ranges or reveal exact values within intervals.
Finding the median interval: With 1,441 ordered observations, the median is the 721st value. Adding bar counts from the left:
- 0-5%: 474 pitches (cumulative: 474)
- 5-10%: 560 pitches (cumulative: 474 + 560 = 1034) The 721st value falls within the 5% to 10% interval, confirming the median is 10% 31.
3.12 Claimed and agreed valuations 32 33 34
This section examines the relationship between the valuation a founder claims and the valuation of the agreed deal in Shark Tank pitches, focusing on deals where an ownership share was exchanged. It highlights how royalty deals, where no ownership is transferred, are recorded and how they are excluded from valuation analysis.
- Royalty deals: In some deals, sharks receive a fixed amount per unit sold or a loan with interest instead of equity. These deals are identified in the dataset by a
deal_equity_pctof 0%. - Valuation implication: When no ownership share is sold, the deal implies no company valuation. The dataset records 0 in
deal_valuation_usdfor these cases, which would inaccurately lower the average agreed valuation. - Data filtering: To accurately analyze valuations, deals with 0% equity for sharks are excluded, leaving 874 deals with a positive ownership share.
The following table summarizes the key valuation metrics for deals with an ownership share:
| Metric | Value |
|---|---|
| Median claimed valuation (USD) | 2,000,000 |
| Median agreed valuation (USD) | 1,000,000 |
| Proportion of deals with agreed valuation < claimed valuation | 0.8146453 |
3.13 What these records can and cannot say
The Shark Tank dataset, comprising 1,441 recorded pitches, offers insights into televised pitches but has inherent limitations regarding broader applicability and causal inference. The data can describe specific events and patterns within the filmed episodes but cannot generalize to all startups or establish cause-and-effect relationships.
- Scope of the data: The file describes only the 1,441 pitches that producers selected for filming and airing. It is not a representative sample of all startups or even all applicants.
- On-air deals: A deal made on camera is not a finalized investment and does not predict future success.
- Variable limitations: Variables like
description_wordsmeasure only what is recorded (e.g., word count in a written description) and not the actual pitch quality or content. - Generalizability: Findings from the dataset apply specifically to these televised pitches. Claims about founders in general require data collected for that purpose.
- Causal claims: The records show correlations (what went together) but cannot prove causation (that changing one factor would change another, like offering less equity leading to a deal).
The dataset can precisely describe the 1,441 recorded pitches, with calculations repeatable by anyone. Of these, 882 (61.2%) resulted in an on-air deal.
Half of the founders offered 10% or less of their company, and the middle 50% offered between 8% and 20%. For deals involving an ownership share, the median agreed valuation was $1.0 million, half of the median claimed valuation of $2.0 million, with 81% of founders accepting a lower valuation than they initially asked for.
These figures can inform decisions, such as a founder's expectation of approximately a three-in-five chance of an on-air deal and the likelihood of accepting a valuation below their claim, assuming their pitch is similar to those selected and the show's dynamics remain consistent 35.
The dataset cannot describe startups in general because producers curated the pitches. It also cannot determine if an on-air deal led to a completed investment or later success, as these outcomes were not measured.
Furthermore, it cannot explain the reasons behind observed patterns, such as whether a lower offer directly causes a deal. This limitation is similar to a class survey describing only the students who responded, not the entire year 36.
📝 A founder asks 40 friends if they would buy a prepared meal box, and 30 say yes (75%). Believing 75% of the market will buy, the founder plans to order packaging. However, friends are more likely to say yes due to their relationship with the founder, meaning the actual market share is likely lower. A better sample would involve asking 50 students encountered randomly, like every tenth person leaving a canteen, to get a closer approximation of the broader market 36.
3.14 Recall questions
These questions test understanding of fundamental data analysis concepts as applied to the Shark Tank dataset. They cover data representation, variable types, sampling bias, and interpreting graphical data.
- Row representation: Each row in the Shark Tank file represents one recorded televised pitch. The file directly describes these 1,441 records from completed Seasons 1 to 16.
- Identifier variable:
pitch_idis an identifier because it labels a unique record. Differences between its values have no inherent numerical meaning. - Sampling variability vs. selection bias: A founder surveying 30 customers randomly drawn from a full list experiences only sampling variability. A founder getting 300 answers to a poll on their own Instagram page faces selection bias, as followers self-selected to respond.
- Variable measurement:
description_wordsmeasures the number of words in the written description of the pitch found in the dataset, not the content or quality of the spoken pitch itself. - Locating the median interval: To find the median interval from a histogram without R, calculate the position of the median (n/2 for n observations) and then sum the counts of the bars from the left. The interval containing the bar where the cumulative count first reaches or exceeds the median position is the median interval 37.
3.15 Reproduce the workflow
This section outlines the process of setting up and running an R script to analyze the Shark Tank data, ensuring reproducibility and verifying data integrity. It involves importing the data, performing initial checks, and adding further validation steps.
- Script setup: Save an R script that imports the Shark Tank file as
sharks. Restart R to clear memory and run the complete script from top to bottom. The script should import data, perform checks, calculate the deal rate, and recreate at least one graph without requiring prior Console commands. - Additional checks:
sort(unique(sharks$deal_on_show)): Verifies thatdeal_on_showcontains only 0 and 1.range(sharks$episode): Confirms episodes range from 1 to 29.range(sharks$description_words): Checks that written descriptions range from 1 to 13 words.table(sharks$pitcher_gender_group, useNA = "ifany"): Identifies gender classifications, noting seven records with unknown gender.anyDuplicated(sharks$pitch_id): Ensures no pitch identifier appears more than once 38.
A successful run reports 1,441 rows and 19 variables, with an on-air deal rate of 61.2% (882 out of 1,441). It also confirms the specified ranges for episodes and description words and recreates graphs without errors 39.
3.16 Explain one graph
This section analyzes two graphs illustrating the equity initially offered in Shark Tank pitches across seasons, distinguishing between pitches that received a deal and those that did not. It examines both mean offers per season and individual pitch offers.
Figure 1.3 displays the mean equity offered per season, separated for pitches with and without an on-air deal. In Seasons 1 to 4, founders offered an average of 19.8% equity, while in Seasons 13 to 16, this dropped to 9.3%. The two lines representing deals and no deals are close and intersect multiple times.
Across all seasons, pitches without a deal offered an average of 14.4% equity, and those with a deal offered 12.4%, a difference of 2 percentage points. This suggests the season is a stronger indicator of offer size than the presence of a deal 39 40.
Figure 1.4 shows each individual pitch's offered equity by season, with separate panels for pitches with and without a deal. Season is ordered chronologically, so pitches from the same season align vertically.
The light points indicate where multiple pitches share the same value, with darker spots signifying higher density. The wide vertical spread within each season demonstrates that a group mean is insufficient to describe every pitch.
Replacing each pitch's offer with its season and deal group mean would introduce errors for most pitches. On average, a pitch's offer deviates by 5.4 percentage points from its mean, which is 41% of the overall mean offer of 13.2%. For instance, in Season 10, pitches with deals offered equity ranging from 2.5% to 33% around a mean of 11.9% 40.
- Figure 1.3 (Season means):
- Variables and units: The graph shows the mean equity initially offered (in percent) by season (horizontal axis), with separate lines for pitches with and without an on-air deal.
- Main pattern: The mean offer decreased from approximately 20% in Seasons 1-4 to about 9% in Seasons 13-16 for both deal groups. The lines for deals and no deals remain within a few percentage points of each other.
- Interpretation: Founders on the show offered smaller shares of their company over time, and in these data, the offered share does not strongly differentiate pitches that secured a deal from those that did not.
- Limitation/Next question: The graph does not explain why offers decreased (e.g., founder learning, producer selection, market valuation changes) nor does it prove that a lower offer causes a deal.
- Figure 1.4 (Every pitch):
- Variables and units: Each point represents one recorded pitch, with season on the horizontal axis and initially offered equity (in percent) on the vertical axis, presented in panels for pitches with and without a deal.
- Main pattern: Offers vary widely within each season, from a few percent to over 25%, centered around a mean that declines over time. The falling mean represents a shift in a broad cloud of offers, not a universal rule.
- Interpretation: The declining mean offer over time is a trend across a wide range of individual offers, not a strict guideline followed by every founder.
- Limitation/Next question: Using the season mean as the offer for a single pitch results in an average error of 5.4 percentage points. Future analysis can measure this spread 41.
3.17 Finish a half-worked example: a histogram reading
This section focuses on interpreting a histogram that displays the distribution of the number of words in the written descriptions of Shark Tank pitches. It involves calculating cumulative counts to find the median and describing the shape of the distribution.
Figure 1.5 illustrates the distribution of description length in words, with the horizontal axis representing word count and the vertical axis showing the number of pitches in each one-word interval. The distribution is slightly right-skewed, meaning most descriptions have 3 to 7 words, with a smaller number of longer descriptions extending further to the right.
The median description length is 5 words. It is important to remember that this variable measures the source text about the pitch, not the pitch itself 41 42.
- Step 1 (given): One observation is a recorded pitch. The axes show description length in words and the pitch count. With 1,441 observations, the median is the 721st ordered value 42.
- Step 2 (you): Cumulative counts are calculated: 4 (for 1 word), 117 (for 1-2 words), 334 (for 1-3 words), 619 (for 1-4 words), and 911 (for 1-5 words). The running total first reaches 721 at the 5-word bar (cumulative count of 911), indicating the median is 5 words.
- Step 3 (you): The distribution is slightly right-skewed, with most values concentrated between 3 and 7 words and a thin tail extending to the right. The graph describes the written text and cannot provide information about the pitch itself 43.
📝 The median for
description_wordsis 5 words, meaning half of the written descriptions have 5 words or fewer, and half have 5 words or more 43.
3.18 Worked exam interpretation
This section presents an exam-style question that requires identifying variable types and interpreting a histogram to find the median interval. It then provides the solution, explaining the reasoning for each part.
- Variable types:
order_value_eur: Numerical and continuous (measures an amount).items: Numerical and discrete (counts whole items).district: Categorical and nominal (labels without inherent order).repeat_customer: Categorical and nominal (binary, 0/1, representing two groups).- Median interval: For 200 orders, the median lies between the 100th and 101st ordered values. Cumulative counts for
order_value_eurare 46 (up to EUR 10) and 120 (up to EUR 20). Therefore, the 100th and 101st values fall within the interval above EUR 10 up to EUR 20, and the median is located in this interval 43.
3.19 Check the AI
This section critically evaluates a statement made by an AI assistant regarding the Shark Tank dataset, using the four-step process: Attempt, Ask, Verify, Explain. The goal is to correct any inaccuracies and ensure the statement is supported by the data.
- AI statement: "The dataset contains 1,441 successful companies and proves that offering less equity makes investors fund startups." 43.
- Correction:
- Attempt: The AI claims the dataset proves a causal link between lower equity offers and investor funding.
- Ask: Does the dataset measure company success, and does it demonstrate causation?
- Verify: The file contains 1,441 recorded televised pitches, not necessarily successful companies. Of these, 882 reached an on-air deal, but the file does not track completed investments or later company success. Founders set their own offers (
equity_offered_pct), meaning offers were not randomly assigned. Therefore, the data cannot prove that a lower offer causes a deal. - Explain: The dataset records 1,441 televised pitches, 882 of which resulted in an on-air deal (61.2%). It does not measure company success or establish a causal relationship, as founders determined their equity offers, and no experiment was conducted to test the effect of offer size on deal acquisition 44.
📝 The AI's statement, "The dataset contains 1,441 successful companies and proves that offering less equity makes investors fund startups," requires correction 43.
3.20 Make it yours
This exercise prompts reflection on a personal venture or a familiar business, identifying a key number to know and the data needed to measure it, along with potential biases in data collection.
- Venture example: A student-run meal-delivery venture on campus.
- Number to know: The share of first-order customers who reorder within 30 days.
- Data needed: Order records linked over time.
- Potential bias: Counting only app users would bias the share upward, as the most loyal customers are more likely to install the app 44.
📝 "The number I most want is the share of first-order customers who order again within 30 days. I would need order records linked over time, and counting only app users would bias the share upward, because the most loyal customers are the ones who install the app." 44.
4. Lecture 2: Probability foundations and random variables
4.1 Start with a founder’s question
This section introduces the need for probability theory to analyze uncertainty in business contexts, using the Shark Tank dataset as an example. It highlights how simple counts can be combined to answer questions about events and their likelihood.
- The Shark Tank dataset contains information on pitches, including whether they secured a deal and if they were from a later season.
- Analyzing this data involves counting occurrences of specific combinations of events, such as having both a deal and being from a late season.
- Simple arithmetic on these counts allows for the calculation of proportions, which represent empirical probabilities based on the observed data 48.
4.2 Answer by counting Why data analysis needs probability
Probability models are essential for understanding and quantifying uncertainty in situations where outcomes are not predetermined. They provide a formal framework for reasoning about chance.
- A random experiment is a process with an uncertain outcome. The term "random" signifies that the model does not predict the specific outcome in advance.
- An outcome (ω) is a single, complete possible result of a random experiment.
- The sample space (Ω) is the set of all possible outcomes for a random experiment.
- An event is a subset of the sample space, representing a collection of outcomes that are of interest for a particular question. An event occurs if the observed outcome is part of that set 50.
| Object | Question it answers | Shark Tank example |
|---|---|---|
| experiment | What is done? | Select one of the 1,441 records at random, each with the same chance |
| outcome | Which complete result occurred? | One complete selected pitch record |
| sample space | Which complete results were possible? | The set of all 1,441 records |
| event | Which outcomes count as “yes” for this question? | The subset of records with an on-air deal |
- For a fair six-sided die roll, the sample space is Ω={1,2,3,4,5,6}. The outcome '4' is a single result. The event "an even number" is the set {2,4,6} 50.
4.3 The experiment: draw one pitch at random from the file
This section formalizes the Shark Tank data analysis by defining the random experiment and key events using set notation. It explains how to combine events using logical operators and introduces the concept of probability.
- The random experiment is defined as selecting one pitch record uniformly at random from the 1,441 available records. This means each record has an equal chance of being selected.
- Two events are defined:
- D: the selected pitch reached an on-air deal.
- L: the selected pitch appeared in a late season (Seasons 9 to 16).
- These events correspond to the R objects
DandLused earlier. Since the selection is uniform, the probability of an event is its proportion within the dataset 51.
4.4 Combining events
Events can be combined using set operations, which have precise meanings in probability theory. These operations allow us to describe more complex scenarios.
- Complement (Ac): The event that A does not occur.
- Intersection (A∩B): The event that both A and B occur.
- Union (A∪B): The event that A, B, or both occur.
- Subset (A⊆B): Every outcome in A is also in B.
- Empty event (∅): The event that contains no outcomes; it never occurs.
- Disjoint events: Events that cannot occur together (A∩B=∅) 51.
The table below illustrates the counts for events D (deal) and L (late season) and their combinations.
| — | No deal (Dc) | Deal (D) | Total |
|---|---|---|---|
| Early seasons (Lc, Seasons 1 to 8) | 330 | 377 | 707 |
| Late seasons (L, Seasons 9 to 16) | 229 | 505 | 734 |
| Total | 559 | 882 | 1441 |
- Dc∩L: No deal and late season (229 records).
- D∩L: Deal and late season (505 records).
- D∪L: Deal, late season, or both (1111 records). This is calculated as the sum of deals and late seasons minus those counted twice: 882+734−505=1111 53.
4.5 Rules for combining events
Several algebraic rules allow for the manipulation and simplification of event combinations. These rules are crucial for calculating probabilities.
- Distributive Laws:
- A∩(B∪C)=(A∩B)∪(A∩C)
- A∪(B∩C)=(A∪B)∩(A∪C).
- De Morgan's Rules:
- (A∪B)c=Ac∩Bc (Not (A or B) is the same as not A and not B)
- (A∩B)c=Ac∪Bc (Not (A and B) is the same as not A or not B) 53.
4.6 Probability rules
Probability assigns a numerical value between 0 and 1 to events, indicating their likelihood. These probabilities must adhere to specific axioms and derived rules.
- Probability (P(A)): A number between 0 and 1 representing the likelihood of event A. A probability of 1 means the event is certain, and 0 means it is impossible 53.
- Probability Axioms:
- Non-negativity: P(A)≥0 for any event A.
- Normalization: P(Ω)=1 (the probability of the entire sample space is 1).
- Additivity: If events A and B are disjoint (A∩B=∅), then P(A∪B)=P(A)+P(B). This extends to any finite or countably infinite sequence of disjoint events 54.
- For a finite sample space with equally likely outcomes, the probability of an event A is calculated as the ratio of the number of outcomes in A to the total number of outcomes in the sample space: P(A)=∣Ω∣∣A∣ 54.
4.7 Derived probability properties
From the basic axioms, several useful properties can be derived for calculating probabilities.
- Complement Rule: P(Ac)=1−P(A).
- Addition Rule: For any two events A and B, P(A∪B)=P(A)+P(B)−P(A∩B). This rule accounts for the overlap between events 54.
Example 2.2 demonstrates the application of the addition rule using the Shark Tank data.
- The probability of a deal (D) is P(D)=1441882≈0.612.
- The probability of a late season (L) is P(L)=1441734≈0.509.
- The probability of both a deal and a late season (D∩L) is P(D∩L)=1441505≈0.350.
- The probability of a deal or a late season (D∪L) is calculated as P(D∪L)=P(D)+P(L)−P(D∩L)=1441882+1441734−1441505=14411111≈0.771 55.
Additional properties include:
- The probability of the empty event is zero: P(∅)=0.
- If event A is a subset of event B (A⊆B), then P(A)≤P(B).
- An event can be partitioned: P(A)=P(A∩B)+P(A∩Bc). For example, the probability of a deal can be split into deals in late seasons and deals in early seasons: P(D)=P(D∩L)+P(D∩Lc) 56.
4.8 Partitions
A partition of a sample space divides it into mutually exclusive and collectively exhaustive events. This concept is useful for organizing probabilities.
- A partition divides Ω into events that do not overlap and together cover all possible outcomes. Each outcome belongs to exactly one event in the partition.
- For the Shark Tank data, the events "early season" (Lc) and "late season" (L) form a partition because every pitch belongs to exactly one of these seasons, and they cover all seasons in the dataset 57.
- Events D and L do not form a partition because they overlap (pitches with both a deal and a late season) and do not cover all outcomes (pitches with no deal and an early season are not included in D∪L) 58.
4.9 From complete outcomes to numerical measurements
This section introduces random variables, which are numerical representations of outcomes from random experiments. It distinguishes between discrete and continuous random variables and defines their support.
- A random variable (X) is a number whose value depends on the outcome of a random experiment. A fixed rule assigns a number to each outcome.
- Random variables are denoted by capital letters (e.g., X), and their specific values are denoted by lowercase letters (e.g., x) 58.
Three examples of random variables from the Shark Tank experiment are:
-
Deal indicator (XD): equals 1 if the pitch got an on-air deal, 0 otherwise.
-
Season (XS): the season number of the pitch.
-
Word count (XW): the number of words in the pitch description 59.
-
A random variable is discrete if its possible values can be listed (e.g., {0,1} for the deal indicator, {1,2,…,16} for the season).
-
A random variable is continuous if it can take any value within an interval (e.g., waiting times).
-
The support of a discrete random variable is the set of values it can take with positive probability 59.
4.10 The formal definition of a random variable
Formally, a random variable is a function that maps outcomes from the sample space to real numbers.
- A random variable X is a function X:Ω→R, where Ω is the sample space and R is the set of real numbers.
- X(ω) is the numerical value assigned by the function X to the outcome ω.
- The event D (a deal occurred) is related to the deal indicator random variable XD by D={ω:XD(ω)=1} 59.
| Symbol | Meaning |
|---|---|
| ω | One complete outcome, such as one selected pitch record |
| X | The fixed measurement rule (function) |
| X(ω) | The number assigned by X to outcome ω |
| x | A possible or realised numerical value of X |
- Empirical proportion vs. Probability: The proportion of deals in the Shark Tank dataset (882/1441 ≈ 0.612) is an empirical proportion. It becomes a forecast for a future pitch only under specific assumptions: the future pitch is similar, selection methods are consistent, the process is stable over time, and the definition of "deal" remains the same 59.
4.11 Answering the driving question
This section synthesizes the concepts of probability and events to answer the initial questions posed about the Shark Tank data, emphasizing the correct application of the addition rule.
- The probability of a deal (D) is approximately 0.612.
- The probability of a late season (L) is approximately 0.509.
- The probability of both a deal and a late season (D∩L) is approximately 0.350.
- The probability of a deal or a late season (D∪L) is approximately 0.771. This is less than the sum of individual probabilities (0.612 + 0.509 = 1.121) because the overlap (D∩L) is subtracted once 60.
4.12 A founder’s decision (invented example)
This example illustrates how probability rules are applied in a practical business scenario to make informed decisions.
- A venture has 400 customers. 12% had a late delivery, 8% gave a low rating, and 3% had both problems.
- The share of customers with at least one problem is calculated using the addition rule: P(late delivery∪low rating)=P(late delivery)+P(low rating)−P(late delivery∩low rating).
- Calculation: 0.12+0.08−0.03=0.17.
- This means 17% of customers have at least one problem. The number of messages needed is 0.17×400=68.
- Simply adding the percentages (12% + 8% = 20%) would incorrectly suggest 80 messages, double-counting the 3% of customers with both issues 61.
4.13 Read the lecture material
This section provides review questions to reinforce understanding of the lecture's key concepts, covering definitions, rules, and the interpretation of probabilities.
4.14 Recall questions
- An outcome is a single, specific result of a random experiment. An event is a set of outcomes that we are interested in.
- A random variable is a rule that assigns a number to each outcome. A realised value is the specific number produced by that rule for an observed outcome.
- The three probability rules are:
- Probabilities are non-negative (P(A)≥0).
- The probability of the sample space is one (P(Ω)=1).
- Probabilities add across disjoint events (P(A∪B)=P(A)+P(B) if A∩B=∅).
- The ratio ∣Ω∣∣A∣ gives the probability of event A when the sample space is finite and all outcomes are equally likely 61.
- To turn an empirical proportion into a forecast for a future pitch, four assumptions are needed: the future pitch is similar to those in the dataset, the selection process is consistent, the underlying process does not change over time, and the definition of "deal" remains the same 63.
4.15 Finish a half-worked example
This exercise applies the addition rule to calculate the probability of a deal or an early season.
- Given: P(D)=1441882, P(E)=1441707 (where E is the early-period event), and P(D∩E)=1441377.
- Applying the addition rule: P(D∪E)=P(D)+P(E)−P(D∩E)=1441882+1441707−1441377=14411212≈0.841.
- Interpretation: Approximately 84.1% of the recorded pitches reached an on-air deal, came from Seasons 1 to 8, or both 62.
4.16 Practice
This set of questions tests the understanding of probability calculations, event complements, and the distinction between events and random variables.
- Calculate and interpret P(Dc).
- P(Dc)=1−P(D)=1−1441882=1441559≈0.388.
- Interpretation: 38.8% of the records did not reach an on-air deal.
- Calculate and interpret P(Dc∪Lc).
- This event leaves out only records that are both deals (D) and from a late season (L). Thus, P(Dc∪Lc)=1−P(D∩L)=1−1441505=1441936≈0.650.
- Alternatively, using the addition rule: P(Dc∪Lc)=P(Dc)+P(Lc)−P(Dc∩Lc)=1441559+1441229−1441330=1441458≈0.318. (Note: The provided solution uses 1−P(D∩L) which is correct for (D∩L)c=Dc∪Lc by De Morgan's laws. The calculation P(Dc)+P(Lc)−P(Dc∩Lc) is also valid if P(Lc) and P(Dc∩Lc) are correctly calculated from the table.)
- Interpretation: 65.0% of the records did not reach an on-air deal, came from Seasons 1 to 8, or both.
- Are D and L disjoint? Explain.
- No, D and L are not disjoint because they can occur together. The intersection D∩L (pitches with both a deal and a late season) has 505 records, meaning it is not empty.
- Define a random variable S that records the season of the selected pitch. State its support.
- S records the season number of the selected pitch record. Its support is {1,2,…,16}.
- Define a deal indicator XD. Explain how the event D and the random variable XD are related but not the same object.
- XD equals 1 when the selected pitch is in D and 0 otherwise.
- The event D is a set of outcomes (pitch records that got a deal). The random variable XD is a measurement rule that assigns a number (0 or 1) to each outcome. D is the set of outcomes for which XD equals 1 63.
4.17 Worked exam interpretation
This section addresses a common misconception about sample sizes and their relation to representativeness.
- A student claims a class survey's average risk score represents Dutch first-year students well due to a large sample size.
- The problem not solved by sample size is selection bias. While a larger sample reduces random variation, the class itself may not be representative of all Dutch first-year students if it was drawn from a specific program or easily accessible group 63.
4.18 Check the AI
This exercise critiques an AI's incorrect probability calculation and provides the corrected answer.
- The AI incorrectly calculated P(deal or late)=1441882+1441734=1.12, resulting in 112%.
- The error is double-counting the overlap (D∩L).
- The corrected answer uses the addition rule: P(D∪L)=1441882+734−505=14411111≈0.771. Probabilities must be between 0 and 1 64.
4.19 Make it yours
This task requires students to apply the concepts to their own venture or a familiar business.
- Example: For a student-run meal box venture, let R be the event that a first-time customer places a second order within 30 days. Knowing P(R)>0.4 would influence spending decisions, shifting budget from new customer acquisition to loyalty rewards 65.
5. Lecture 3: Discrete distributions, expectation, and variance
5.1 Probability mass function (PMF)
A random variable assigns numerical values to outcomes of an experiment. Its probability mass function (PMF) specifies the probability for each of these possible values.
The PMF is essential for understanding the likelihood of specific outcomes in discrete probability distributions.
-
PMF notation: pX(x)=P(X=x)
-
X: the random variable.
-
x: a possible numerical value of X.
-
pX(x): the probability that X equals exactly x.
-
This probability is also called the probability mass.
-
Valid PMF rules:
-
pX(x)≥0 for every x in the support of X.
-
∑x∈XpX(x)=1, where X is the support of X.
-
Shark Tank example: The number of sharks in a deal.
-
Possible values (support): 1, 2, 3, 4, 5.
-
PMF values:
-
pK(1)≈0.735
-
pK(2)≈0.230
-
pK(3)≈0.025
-
pK(4)≈0.003
-
pK(5)≈0.007
-
This distribution shows that most deals have one shark, and deals with three or more are rare.
-
Worked example: the deal-indicator PMF, checked
For the deal indicator variable X (1 for a deal, 0 for no deal), with 882 deals out of 1,441 records:
- pX(0)=559/1441≈0.388
- pX(1)=882/1441≈0.612 Both rules for a valid PMF are met: 0.388≥0, 0.612≥0, and 0.388+0.612=1. This means that, on average, about 61.2% of recorded pitches reach a deal.
5.2 Cumulative distribution function (CDF)
While the PMF gives the probability of an exact value, the cumulative distribution function (CDF) provides the probability that a random variable takes on a value less than or equal to a specific threshold. The CDF is useful for answering questions about ranges of values and is particularly important for continuous random variables.
-
CDF notation: FX(a)=P(X≤a)
-
X: the random variable.
-
a: a threshold value.
-
FX(a): the probability that X is at or below the threshold a.
-
Calculation for discrete variables: The CDF is the sum of all PMF values for outcomes less than or equal to the threshold: FX(a)=∑x≤apX(x).
-
Shark Tank example (number of sharks, K):
-
FK(2)=P(K≤2)=pK(1)+pK(2)=0.735+0.230=0.965.
-
This means about 96.5% of deals have at most two sharks.
-
Properties of a CDF:
-
It is non-decreasing: FX(a) can only stay flat or rise as a increases.
-
It approaches 0 as a approaches negative infinity.
-
It reaches 1 as a approaches positive infinity.
-
For discrete variables, it is a step graph, jumping at each value in the support.
-
Calculating interval probabilities: The probability of a value falling between two thresholds a and b (where a<b) is found by subtracting CDF values: P(a<X≤b)=FX(b)−FX(a).
-
Worked example: FK(2) for the number of sharks, by hand
To find the probability of a deal having at most two sharks (K≤2), we sum the probabilities for one and two sharks: FK(2)=P(K≤2)=pK(1)+pK(2)=882648+882203=882851≈0.965.
📝 For the number of sharks (K), the probability of a deal having at most two sharks is FK(2)=P(K≤2)=pK(1)+pK(2)=882648+882203=882851≈0.965.
5.3 Expected value
The expected value, denoted E[X] or μ, represents the central tendency of a random variable. It is calculated as the probability-weighted average of all possible values the variable can take.
The expected value provides a long-run average outcome if the experiment were repeated many times.
-
Definition: E[X]=∑x∈Xx⋅pX(x)
-
This is the sum of each possible value multiplied by its probability.
-
It can also be denoted as μ or μX.
-
Interpretation: The expected value is the balance point of the probability distribution. It is not necessarily a possible value of the random variable itself.
-
E[K]=(1×0.735)+(2×0.230)+(3×0.025)+(4×0.003)+(5×0.007)≈1.32.
-
This indicates that, on average, a deal has about 1.32 sharks.
-
Expected value of a function of a random variable: If g(X) is a function of X, its expected value is E[g(X)]=∑x∈Xg(x)⋅pX(x). The expectation of a function is not generally equal to the function of the expectation, i.e., E[g(X)]=g(E[X]) unless g is a linear function.
-
Worked example: expectation of a tiny PMF
For a variable Y with support {0,1,2} and pY(0)=0.2,pY(1)=0.5,pY(2)=0.3: E[Y]=(0×0.2)+(1×0.5)+(2×0.3)=0+0.5+0.6=1.1.
5.4 Variance and standard deviation
While the expected value indicates the center of a distribution, variance and standard deviation measure its spread or dispersion. Variance quantifies the average squared deviation of the random variable's values from its expected value, indicating how much the outcomes typically differ from the mean.
Standard deviation is the square root of the variance, providing a measure of spread in the original units of the variable.
-
Variance definition: Var(X)=σ2=E[(X−μ)2]=∑x∈X(x−μ)2⋅pX(x)
-
μ is the expected value E[X].
-
(x−μ) is the deviation of a value from the mean.
-
(x−μ)2 is the squared deviation.
-
The variance is the probability-weighted average of these squared deviations.
-
Interpretation: Variance measures the average squared distance from the mean. It is always zero or positive. A variance of zero means the variable is not random; all probability mass is at a single value.
-
Shortcut formula for variance: Var(X)=E[X2]−(E[X])2
-
This formula calculates variance as the expected value of the squares minus the square of the expected value.
-
It is often computationally simpler than the definition.
-
Standard deviation: SD(X)=σ=Var(X)
-
It is the square root of the variance.
-
It has the same units as the random variable X, making it more interpretable than variance.
-
E[K]≈1.32
-
E[K2]≈2.10
-
Var(K)=E[K2]−(E[K])2≈2.10−(1.32)2≈2.10−1.74=0.36. (Note: The document's calculation for E[K2] is 2.1043084, and E[K] is 1.3174603. Using these more precise values: Var(K)≈2.1043084−(1.3174603)2≈2.1043084−1.735601≈0.3687).
-
SD(K)=Var(K)≈0.3687≈0.61.
-
Worked example: variance of the tiny PMF, both ways 66.
For Y with values {0,1,2} and pY(0)=0.2,pY(1)=0.5,pY(2)=0.3, and E[Y]=1.1:
- By definition: Var(Y)=(0−1.1)2(0.2)+(1−1.1)2(0.5)+(2−1.1)2(0.3)=0.242+0.005+0.243=0.49.
- By shortcut: E[Y2]=(02×0.2)+(12×0.5)+(22×0.3)=0+0.5+1.2=1.7. Var(Y)=E[Y2]−(E[Y])2=1.7−(1.1)2=1.7−1.21=0.49. The standard deviation is SD(Y)=0.49=0.7. The variance is 0.49, and the standard deviation is 0.7.
5.5 Expectation and variance in practice
Expectation and variance are key statistical measures that summarize a probability distribution. Expectation represents the average value of a random variable, while variance quantifies the spread or dispersion of its possible outcomes around the expectation.
These measures are crucial for decision-making, especially in business, where understanding both the central tendency and the variability of outcomes is essential for planning and risk assessment 85.
- Standard deviation: The square root of the variance, providing a measure of spread in the same units as the random variable.
- Interpretation of variance: For the number of sharks in a deal, the variance of approximately 0.37 "sharks squared" indicates the spread of outcomes. The standard deviation of about 0.61 sharks suggests that the number of sharks in a deal typically deviates from the expected value by less than one shark.
- Risk assessment: When comparing options with equal expected payoffs, such as two investment choices, the variance or standard deviation helps determine which option is riskier. A higher variance indicates greater risk due to a wider spread of potential outcomes 85.
📝 Option A pays EUR 100 for sure, with an expected value of EUR 100 and a variance of 0. Option B pays EUR 0 or EUR 200 with equal probability, also with an expected value of EUR 100 but a variance of 10,000 euros squared. Option B is riskier due to its higher variance 85.
5.6 Bernoulli distribution
The Bernoulli distribution is a simple discrete probability distribution that describes a random variable with only two possible outcomes, typically labeled 0 and 1. This distribution is fundamental for modeling binary events, such as whether a customer makes a purchase, a loan is repaid, or a business pitch is successful. A single parameter, p, which represents the probability of success (outcome 1), completely defines the distribution 86.
- Definition: A random variable X that takes values 0 or 1 with P(X=1)=p and P(X=0)=1−p follows a Bernoulli distribution, denoted as X∼Bernoulli(p).
- Expected value: For a Bernoulli distribution, the expected value is E[X]=p.
- Variance: The variance of a Bernoulli distribution is Var(X)=p(1−p).
- Maximum variance: The variance of a Bernoulli distribution is maximized when p=0.5, where it equals 0.25. This occurs when the two outcomes are equally likely, similar to a fair coin toss 86.
📝 The deal indicator for Shark Tank pitches, where p≈0.612, is a Bernoulli variable. Its expected value is approximately 0.612, and its variance is approximately 0.612×(1−0.612)≈0.237 86.
5.7 Rules for expectation and variance
Linear transformations of random variables follow predictable rules for their expectation and variance. These rules are essential for calculating the expected value and spread of composite variables, such as revenue (price times units) or profit (revenue minus costs), without needing to derive their full probability mass functions 87.
- Adding a constant: If a constant b is added to a random variable X, the expected value shifts by b, but the variance remains unchanged: E[X+b]=E[X]+b and Var(X+b)=Var(X).
- Multiplying by a constant: If a random variable X is multiplied by a constant a, its expected value is scaled by a, and its variance is scaled by a2: E[aX]=aE[X] and Var(aX)=a2Var(X). The standard deviation is scaled by ∣a∣.
- Combined linear transformation: For a transformation of the form aX+b, the expected value is E[aX+b]=aE[X]+b, and the variance is Var(aX+b)=a2Var(X) 87.
📝 If daily sales Y have an expected value of 1.1 and a variance of 0.49, then a profit calculation of 10Y−3 (10 euros per unit, 3 euros fixed cost) would have an expected profit of 10(1.1)−3=8 euros and a variance of 102(0.49)=49 euros squared 87.
5.8 Empirical distribution and sample statistics
When analyzing observed data, we can treat the data itself as an empirical probability distribution. The sample mean and empirical variance are calculated from this distribution.
However, when using sample data to estimate population parameters, different formulas are used for variance and standard deviation, typically involving division by n−1 instead of n. [88-89]
- Empirical distribution: Assigns a probability of 1/n to each of the n observed data points.
- Sample mean: The average of the observed data points, calculated as xˉ=n1∑i=1nxi. This is equivalent to the expectation of the empirical distribution 88.
- Empirical variance: Calculated as the average of the squared deviations from the sample mean: n1∑i=1n(xi−xˉ)2. [88-89]
- Sample variance: Used to estimate the population variance, calculated as s2=n−11∑i=1n(xi−xˉ)2. The division by n−1 provides an unbiased estimate.
- Sample standard deviation: The square root of the sample variance, s 89.
📝 For daily sales of 3, 5, 6, 8, and 8 orders, the sample mean is 6 orders. The sample variance is 4.5 orders squared, and the sample standard deviation is approximately 2.12 orders 89.
5.9 Interpreting expectation and standard deviation
Expectation and standard deviation provide complementary insights into a random variable's behavior. While the expectation gives a central value, the standard deviation quantifies the typical deviation from this center.
Understanding both is crucial for making informed decisions, especially when outcomes can vary significantly 90.
- Expectation is not a promise: The expected value of a random variable is a weighted average and may not be a value the variable can actually take. It represents a long-term average if the experiment were repeated many times.
- Standard deviation as typical deviation: The standard deviation indicates how much, on average, individual outcomes are likely to differ from the expected value.
- Contextual interpretation: When interpreting these values, it's important to consider their units and the context of the problem. For instance, a standard deviation of 0.61 sharks means that the number of sharks in a deal typically varies by about 0.61 from the expected 1.32 sharks 90.
📝 For Shark Tank deals, the expected number of sharks is 1.32, and the standard deviation is 0.61. This means that while the average number of sharks per deal is 1.32, the actual number in any given deal typically differs from this average by about 0.61 sharks 90.
5.10 Decision-making with expected cost
When faced with uncertain demand and associated costs for overstocking or understocking, calculating the expected cost for different production or preparation plans is essential for making optimal decisions. This involves determining the costs for each possible demand scenario under each plan and then averaging these costs, weighted by their probabilities. [91-92]
- Steps for decision-making:
- Calculate the expected demand and its standard deviation.
- For each plan, determine the cost associated with each possible demand level.
- Calculate the expected cost for each plan by weighting these costs by their probabilities 91.
- Cost factors: Costs can arise from unsold inventory (e.g., cost of ingredients) or from unmet demand (e.g., lost margin from a customer) 92.
📝 A lunch start-up can prepare 20, 30, or 40 meal boxes. With expected demand of 31 boxes and costs of EUR 3 for unsold boxes and EUR 5 for unmet demand, preparing 30 boxes results in the lowest expected cost (EUR 21), making it the optimal plan 92.
5.11 Practice problems and review
This section provides practice problems that reinforce the concepts of probability mass functions (PMFs), cumulative distribution functions (CDFs), expectation, variance, and standard deviation. These exercises cover calculations for invented distributions, application to real-world data like Shark Tank, and interpretation of statistical measures. [93-97]
- PMF and CDF: The PMF gives the probability of a random variable taking a specific value, while the CDF gives the probability of it taking a value less than or equal to a specific value 93.
- Interpreting variance vs. standard deviation: Variance is measured in squared units (e.g., "sharks squared"), making it difficult to interpret directly. Standard deviation, being the square root of variance, returns to the original units (e.g., "sharks"), making it more intuitive for describing spread 95.
- Exam-style question: A venture selling a product at different prices requires calculating the expected revenue, variance, and standard deviation to understand the typical revenue per customer and its variability 96.
| Concept | Definition/Formula |
|---|---|
| PMF | P(X = x) |
| CDF | P(X ≤ x) |
| Expected Value (Discrete) | E[X = Σ x * P(X = x) |
| Variance (Discrete) | Var(X) = E[(X - E[X])^2 = E[X^2 - (E[X])^2 |
| Bernoulli Distribution | X ~ Bernoulli(p), E[X = p, Var(X) = p(1-p) |
| Linear Transformation | E[aX + b = aE[X + b, Var(aX + b) = a^2 Var(X) |
-
Worked exam interpretation: For a product with prices of EUR 10 (p=0.5), EUR 20 (p=0.3), and EUR 40 (p=0.2), the expected revenue is EUR 19, the variance is 129 euros squared, and the standard deviation is approximately EUR 11.4. [96-97]
-
Check the AI: An AI assistant incorrectly stated that the expected value is the most likely value. The expected value is a weighted average, while the most likely value is the mode of the distribution. For Shark Tank deals, the most likely number of sharks is one (73.5% of deals), not the expected 1.32 97.
6. Tutorial 1: Evidence and probability foundations
6.1 Data and measurement
An observational unit is the fundamental entity described by a single row in a dataset. It is crucial to distinguish between the data collected and the claims made about it, as the data may not fully support the claims 100 101.
- Observational unit: In the Shark Tank dataset, each row represents a single televised pitch 100.
- Claim interpretation: A claim stating "The data contain 1,441 successful companies" is inaccurate because the data record whether a deal was made on the show, not the ultimate success or funding of the company.
- Median interpretation: A median of 5 words for descriptions indicates that at least half of the pitch descriptions have 5 words or fewer, and at least half have 5 words or more. The median is not affected by extreme values, such as descriptions of 12 or 13 words, because it only considers the middle value of the ordered data 101.
6.2 Variables and samples
Variables in a dataset can be classified by their type, such as categorical, numerical, or identifier. When collecting samples, it is important to consider potential biases, such as selection bias, which can occur when the sample is not representative of the target population 101.
- Variable types:
order_id: Identifier.drink: Categorical, nominal.cup_size: Categorical, ordinal.items: Numerical, discrete.amount_eur: Numerical, continuous.- Selection bias: In a survey of loyalty-card holders about paying more for oat milk, the main problem is selection bias. Loyalty-card holders are regular customers who are likely more inclined to pay extra, making the sample unrepresentative of the general customer base 101.
📝 A survey of loyalty-card holders about paying more for oat milk is problematic due to selection bias, as these regular customers may be more willing to pay extra than the general customer base 101.
6.3 Events and probability rules
An event is a specific subset of the sample space, which is the set of all possible outcomes of a random experiment. Probability rules, such as the addition rule and the complement rule, are used to calculate the likelihood of these events 101 102.
- Sample space: The sample space (Ω) consists of 1,014 pitch records from the Shark Tank data that have a value for
multiple_entrepreneurs. - Outcome vs. Event: An outcome is a single selected record from the sample space. An event is a collection of outcomes; for example,
Drepresents the event of an on-air deal. - Event definitions:
- Dc: No on-air deal.
- D∩M: An on-air deal for a pitch presented by more than one entrepreneur.
- D∪M: An on-air deal, a pitch by more than one entrepreneur, or both.
- Probability calculations:
- P(Dc)=1014242+147≈0.384.
- P(D∪M)=P(D)+P(M)−P(D∩M)=1014625+1014463−1014316=1014772≈0.761.
- Generalizability: These probabilities do not automatically apply to a future US entrepreneur because they are derived from a specific dataset and context. To apply them, a defined target population, comparable selection criteria, time period, and outcome are necessary 102.
6.4 PMF, CDF, and expectation
A Probability Mass Function (PMF) assigns probabilities to each possible value of a discrete random variable, with probabilities being non-negative and summing to 1. The Cumulative Distribution Function (CDF) provides the probability that a random variable takes on a value less than or equal to a specific threshold. The expectation, or expected value, represents the probability-weighted average of the possible values of a random variable 103.
- Indicator variable: Let X be an indicator variable where X=1 if equity offered is ≥20% and X=0 otherwise 103.
- PMF: The PMF for X is:
| x | p_X(x) |
|---|---|
| 0 | 1 - p \approx 0.735 |
| 1 | p \approx 0.265 |
The masses sum to 1−p+p=1.
- CDF: The full piecewise CDF for X is: FX(a)=⎩⎨⎧0,1−p≈0.735,1,a<0,0≤a<1,a≥1..
- Expectation: The expectation E[X]=0(1−p)+1p=p≈0.265. This means about one in four pitches offers at least 20% equity. This is twice the median offer of 10%.
- Realized value: X is the random variable, a rule assigning a number to each pitch. A realized value, x, is the specific number obtained for a particular pitch (e.g., 0 or 1) 103.
6.5 Variance from a small PMF
Variance measures the average squared deviation of a random variable from its mean, quantifying the spread of the distribution. The standard deviation, the square root of the variance, provides this spread in the original units of the variable 104.
- Variance calculation:
- Definition form: Var(N)=E[(N−E[N])2].
- Computational form: Var(N)=E[N2]−(E[N])2 104.
- Results:
| Quantity | Value |
|---|---|
| E[N | 0.7 offers |
| Var(N) | 0.61 squared offers |
| SD(N) | \sqrt{0.61} \approx 0.78 offers |
The standard deviation measures the typical distance of the number of offers from the mean of 0.7.
- Linear transformation: For a linear transformation T=aN+b, the expectation is E[T]=aE[N]+b and the standard deviation is SD(T)=∣a∣SD(N).
- For T=3N+2 hours:
- E[T]=3E[N]+2=3(0.7)+2=4.1 hours.
- SD(T)=∣3∣SD(N)≈3(0.78)=2.34 hours 104.
6.6 Check the AI
AI assistants can sometimes make errors in interpreting statistical concepts, such as confusing expected values with the most likely outcome or misinterpreting the units of variance 104 105.
- AI Error 1: The statement "most start-ups get 0.7 offers" is incorrect because 0.7 is the expected value (average), not the most likely outcome. The number of offers is a count (0, 1, or 2), and the expected value is a probability-weighted average, not a possible value for a single start-up. The most likely number of offers is 0, with a probability of 0.5.
- AI Error 2: The statement "the number of offers typically differs from 0.7 by 0.61 offers" is incorrect because 0.61 is the variance, which is in squared units. The typical difference is measured by the standard deviation, which is approximately 0.78 offers.
- Corrected answer: On average, a start-up receives 0.7 offers. Half of the start-ups receive no offer. The number of offers typically differs from the average by about 0.78 offers 105.
📝 An AI incorrectly states that "most start-ups get 0.7 offers" because 0.7 is the expected value (average), not the most likely outcome, which is 0 offers 105.
6.7 Two options, compared by expected value and spread
When comparing different options with uncertain outcomes, it is useful to calculate their expected values, variances, standard deviations, and probabilities of loss. These metrics help in making informed decisions based on risk tolerance 105 106.
- Option A (Side street shop) vs. Option B (Christmas market booth):
| Metric | Option A (X) | Option B (Y) |
|---|---|---|
| Expected Profit (thousands EUR) | 2.0 | 3.0 |
| Variance (thousands EUR^2) | 1.00 | 6.60 |
| Standard Deviation (thousands EUR) | 1.00 (1000 EUR) | ≈ 2.57 (2570 EUR) |
| Probability of Loss | 0 | 0.10 |
- Decision support:
- Option B has a higher expected profit (3,000 EUR vs. 2,000 EUR).
- Option A has a smaller standard deviation (1,000 EUR vs. approx. 2,570 EUR), indicating less variability.
- Option A has a 0% probability of loss, while Option B has a 10% probability of losing 2,000 EUR.
- Risk attitude: Founders who are risk-averse might choose Option A to avoid losses, while founders who can tolerate potential losses might choose Option B for its higher expected profit 106.
6.8 Individual practice
The mean and median of a numerical variable provide insights into its central tendency and distribution shape. The range indicates the spread between the minimum and maximum values 107 108.
- Shark Tank
ask_amount_usd: - Mean: 283,511 dollars.
- Median: 200,000 dollars 107.
- Comparison: The mean is higher than the median, suggesting a right-skewed distribution due to a few very large asks.
- Range: 5,000,000 - 10,000 = 4,990,000 dollars.
- Measurement: The variable measures the amount asked by founders, not the amount invested or received.
- Expectation: If each record has an equal probability, the expectation of this distribution is its mean, approximately 283,511 dollars 108.
6.9 More practice: Read a histogram
A histogram visually represents the distribution of numerical data by dividing the data into bins (intervals) and showing the frequency or count of observations within each bin. It helps in understanding the shape, center, and spread of the data 109 110.
- Histogram interpretation:
- Observation unit: Each bar represents the number of orders, and the axes show delivery time (minutes) and the count of orders.
- Tallest bar: 46 orders had delivery times between 10 and 20 minutes (inclusive of the upper limit).
- Median interval: The median lies between the 60th and 61st order. Cumulative counts show this falls within the 10-20 minute interval (cumulative count of 64).
- Upper quartile interval: The upper quartile (Q3) is at the 90th and 91st order. Cumulative counts place this within the 20-30 minute interval (cumulative count of 96).
- Shape and limitations: The distribution is right-skewed, with most orders arriving within 30 minutes and a few taking much longer. The histogram does not reveal specific late orders, their reasons, or exact times within intervals 110.
6.10 Mean, spread, and quartiles from a frequency table
A frequency table can be used to calculate descriptive statistics for a dataset, including the mean, variance, standard deviation, median, and quartiles. These statistics provide a summary of the data's central tendency and dispersion 111 112.
- Escape room bookings (40 bookings):
| Group size (persons) | Number of bookings | Relative frequency | Cumulative count |
|---|---|---|---|
| 2 | 4 | 0.10 | 4 |
| 3 | 12 | 0.30 | 16 |
| 4 | 10 | 0.25 | 26 |
| 5 | 8 | 0.20 | 34 |
| 6 | 6 | 0.15 | 40 |
- Calculations:
- Mean group size: 4.0 persons.
- Variance (dividing by n): 1.50 persons2.
- Standard deviation (dividing by n): ≈1.22 persons.
- Sample variance (dividing by n−1): ≈1.54 persons2.
- Sample standard deviation (dividing by n−1): ≈1.24 persons.
- Median: 4 persons.
- Lower quartile (Q1): 3 persons.
- Upper quartile (Q3): 5 persons.
- Interquartile range (IQR): 5−3=2 persons. The middle 50% of bookings are between 3 and 5 persons.
- Shape: The mean and median are equal (4 persons), indicating a symmetric distribution 112.
6.11 A random experiment, its sample space, and events
A random experiment involves an uncertain outcome, and its sample space (Ω) lists all possible outcomes. Events are subsets of the sample space, and their probabilities can be calculated using basic probability rules 113 114.
- Hoodie size probabilities:
| Size | Probability |
|---|---|
| XS | 0.05 |
| S | 0.20 |
| M | 0.35 |
| L | 0.30 |
| XL | 0.10 |
- Sample space: Ω={XS, S, M, L, XL}.
- Outcome vs. Event: 'L' is an outcome (a single result). {L} is an event (a set containing one outcome).
- Event probabilities:
- P(A)=P(XS, S, M)=0.05+0.20+0.35=0.60.
- P(B)=P(S, M, L)=0.20+0.35+0.30=0.85.
- Complement events:
- Ac={L, XL}, P(Ac)=1−P(A)=1−0.60=0.40.
- Bc={XS, XL}, P(Bc)=1−P(B)=1−0.85=0.15.
- Intersection and Union:
- A∩B={S, M}, P(A∩B)=0.20+0.35=0.55.
- A∪B={XS, S, M, L}, P(A∪B)=P(A)+P(B)−P(A∩B)=0.60+0.85−0.55=0.90.
- Neither event: XL is neither in A nor in B. P(XL)=0.10. This can be calculated as P((A∪B)c)=1−P(A∪B)=1−0.90=0.10 114.
- Assumption: The founders assume that the probabilities from last year's orders will accurately predict the size distribution for the next order 115.
📝 The sample space for hoodie sizes is Ω={XS, S, M, L, XL}, and the event of ordering a size up to medium is A={XS, S, M}, with probability P(A)=0.05+0.20+0.35=0.60 114.
6.12 From a CDF to probabilities and to the PMF
A Cumulative Distribution Function (CDF) provides the probability that a random variable is less than or equal to a given value. The PMF can be derived from the CDF by examining the jumps in probability at each possible value 116 117.
- Cargo bike rentals (4 bikes):
| Threshold (a) | CDF, F_X(a) = P(X \le a) |
|---|---|
| a < 0 | 0 |
| 0 \le a < 1 | 0.05 |
| 1 \le a < 2 | 0.20 |
| 2 \le a < 3 | 0.50 |
| 3 \le a < 4 | 0.80 |
| a \ge 4 | 1 |
- Possible values: The possible values for X (number of bikes rented) are 0, 1, 2, 3, and 4, indicated by the thresholds where the CDF jumps.
- CDF values:
- FX(2)=0.50: With 50% probability, at most 2 bikes are rented.
- FX(2.5)=0.50: Since X takes integer values, P(X≤2.5)=P(X≤2).
- FX(6)=1: The probability that X is less than or equal to 6 is 1, as 4 is the maximum value.
- Probabilities:
- P(X>2)=1−FX(2)=1−0.50=0.50.
- P(1<X≤3)=FX(3)−FX(1)=0.80−0.20=0.60.
- P(1≤X≤3)=FX(3)−FX(0)=0.80−0.05=0.75 117.
- PMF recovery: The PMF is found by the difference between consecutive CDF values:
| x | p_X(x) |
|---|---|
| 0 | 0.05 |
| 1 | 0.15 |
| 2 | 0.30 |
| 3 | 0.30 |
| 4 | 0.20 |
The probabilities are non-negative and sum to 1.
- Interpretation: P(X=4)=0.20 means that on about one Saturday in five, all four bikes are rented out. This number does not indicate how many students might have been turned away due to lack of availability 117.
7. Lecture 4: Conditioning, Bayes’ rule, and independence
7.1 Conditional probability
Conditional probability quantifies the likelihood of an event occurring given that another event has already occurred. This involves restricting the sample space to the outcomes of the known event, which then becomes the reference class 123.
- Reference class: The set of outcomes for which the condition is true.
- Conditioning: The process of restricting attention to a reference class 123.
- Conditional probability formula: For events A and B with P(B)>0, the conditional probability of A given B is P(A∣B)=P(B)P(A∩B).
- Interpretation: This formula calculates the proportion of outcomes in event B that are also in event A 124.
The complement rule and addition rule also hold within a fixed reference class. For example, the probability of A not happening given B is P(Ac∣B)=1−P(A∣B) 125.
Example 4.1 (Worked example: what each of the two sentences means) Sentence A, "68.8% of late-season pitches reached an on-air deal," refers to P(D∣L), where the reference class is late-season pitches. Sentence B, "57.3% of the pitches that reached a deal came from the late seasons," refers to P(L∣D), where the reference class is pitches that reached a deal 125 126.
📝 Sentence A: P(D∣L)=734505≈0.688. Sentence B: P(L∣D)=882505≈0.573 126.
7.2 The multiplication rule 128
The multiplication rule allows for the calculation of the joint probability of two events by multiplying the probability of one event by the conditional probability of the other event given the first. This rule is derived directly from the definition of conditional probability 127.
- Joint probability: The probability that both events A and B occur, denoted as P(A∩B).
- Multiplication rule: P(A∩B)=P(A∣B)P(B).
- Symmetric form: The rule also holds as P(A∩B)=P(B∣A)P(A), since A∩B is the same event as B∩A 127.
This rule explains why two sentences can share the same numerator (the joint probability) but have different denominators (the conditional probabilities based on different reference classes) 127.
Example 4.2 (Worked example: verifying the joint probability) The joint probability of a pitch being a deal and from a late season can be calculated directly from the counts table or by using the multiplication rule in two ways 128.
| Method | Calculation | Result |
|---|---|---|
| Direct count | P(D∩L)=1441505 | ≈0.350 |
| P(D∣L)P(L) | 734505×1441734 | ≈0.350 |
| P(L∣D)P(D) | 882505×1441882 | ≈0.350 |
7.3 The law of total probability
The law of total probability provides a method to calculate the overall probability of an event by summing the probabilities of that event occurring within each part of a partition. This is particularly useful when data is available as rates for separate groups 129.
- Partition: A set of events that do not overlap and together cover all possible outcomes.
- Law of total probability: For a partition B1,…,Bk where P(Bi)>0 for all i, the probability of event A is P(A)=∑i=1kP(A∣Bi)P(Bi).
- Weighted average: The overall probability of A is a weighted average of its probabilities within each group, where the weights are the probabilities of the groups themselves 129.
For a partition consisting of an event B and its complement Bc, the law simplifies to P(A)=P(A∣B)P(B)+P(A∣Bc)P(Bc) 129.
Example 4.3 (Worked example: rebuilding P(D) from the deal rates of the two periods) The events "early season" (Lc) and "late season" (L) form a partition. The overall probability of a deal P(D) can be rebuilt from the deal rates within each period and the proportion of pitches in each period 129.
- Deal rate in early seasons: P(D∣Lc)=707377≈0.533.
- Proportion of early seasons: P(Lc)=1441707≈0.491.
- Deal rate in late seasons: P(D∣L)=734505≈0.688.
- Proportion of late seasons: P(L)=1441734≈0.509 129.
The overall deal probability is P(D)=P(D∣Lc)P(Lc)+P(D∣L)P(L)=707377×1441707+734505×1441734=1441377+1441505=1441882≈0.612 129.
7.4 Bayes’ rule
Bayes' rule is a fundamental tool for updating probabilities based on new evidence. It allows us to reverse conditional probabilities, transforming a probability described in terms of a signal's quality into the probability of the underlying event given the signal 130 131 132.
- Bayes' rule: For events A and B with P(A)>0, it states P(B∣A)=P(A)P(A∣B)P(B).
- Updating probabilities: It calculates the probability of an event (B) given new evidence (A), using the probability of the evidence given the event (P(A∣B)), the prior probability of the event (P(B)), and the overall probability of the evidence (P(A)) 132.
When the denominator P(A) is unknown, it can be expanded using the law of total probability, especially when A is conditioned on a partition B1,…,Bk: P(Bi∣A)=∑j=1kP(A∣Bj)P(Bj)P(A∣Bi)P(Bi) 132.
Example 4.3 (Worked example: 1,000 imaginary pitches) A venture fund uses an AI tool to flag promising pitches. The base rate of deals is 10% (P(deal)=0.10). The tool flags 80% of actual deals (P(flag∣deal)=0.80) and 20% of non-deals (P(flag∣no deal)=0.20). When a pitch is flagged, the probability of a deal is updated 131.
- Counts:
- Total pitches: 1,000
- Deals: 1000×0.10=100
- Non-deals: 1000×0.90=900
- Flagged deals: 100×0.80=80
- Flagged non-deals: 900×0.20=180
- Total flagged pitches: 80+180=260.
- Conditional probability: The probability of a deal given a flag is P(deal∣flag)=26080≈0.31 131.
Using Bayes' rule: P(deal∣flag)=P(flag∣deal)P(deal)+P(flag∣no deal)P(no deal)P(flag∣deal)P(deal) P(deal∣flag)=0.80×0.10+0.20×0.900.80×0.10=0.08+0.180.08=0.260.08≈0.308 132 133.
7.5 Independence of events 135
Two events are considered independent if the occurrence of one event does not affect the probability of the other event occurring. This means that knowing one event has happened provides no new information about the likelihood of the other 134.
- Definition of independence: Events A and B are independent if P(A∣B)=P(A) (assuming P(B)>0).
- Product form: An equivalent condition for independence is P(A∩B)=P(A)P(B).
- Dependent events: Events that are not independent are called dependent 134.
It is crucial to distinguish independence from disjointness. Disjoint events cannot occur together (P(A∩B)=0), whereas independent events can occur together with a probability equal to the product of their individual probabilities 135.
Example 4.4 (Worked example: are D and L independent?) To check if "deal" (D) and "late season" (L) are independent, we compare P(D∣L) with P(D) and P(D∩L) with P(D)P(L) 134.
- Conditional probability check: P(D∣L)≈0.688, while P(D)≈0.612. Since 0.688=0.612, the events are dependent.
- Product form check: P(D∩L)≈0.350, while P(D)P(L)≈0.612×0.509≈0.312. Since 0.350=0.312, the events are dependent 134.
| Comparison | Value 1 | Value 2 | Are they equal? |
|---|---|---|---|
| P(D∣L) vs P(D) | ≈0.688 | ≈0.612 | No |
| Comparison | Value 1 | Value 2 | Are they equal? |
|---|---|---|---|
| P(D∩L) vs P(D)P(L) | ≈0.350 | ≈0.312 | No |
Disjoint vs. Independent Events
| Feature | Disjoint Events | Independent Events |
|---|---|---|
| Meaning | Never happen together | Learning that B happened does not change the chance of A |
| Condition | P(A∩B)=0 | P(A∩B)=P(A)P(B) |
| Example | Pitch is early season (Lc) and late season (L) | First coin toss is heads, second coin toss is heads |
7.6 Comparing success rates of groups
Comparing success rates across different groups is a common application of conditional probability. This involves calculating the conditional probability of success for each group, using the group as the reference class 136.
- Conditional probability for groups: P(Deal∣Category) represents the deal rate within a specific category of teams (e.g., all-men, all-women, mixed) 136.
- Importance of shares: Comparing shares (conditional probabilities) is essential rather than raw counts, as group sizes can vary significantly. Shares normalize for these differences, allowing for a fair comparison of success rates 137.
Shark Tank data: Deal rates by team composition The deal rates for different pitcher gender groups are calculated as follows 136:
- All-men teams: P(Deal∣all_men)≈0.581 (58.1% of pitches by all-men teams reached a deal).
- All-women teams: P(Deal∣all_women)≈0.636 (63.6% of pitches by all-women teams reached a deal).
- Mixed teams: P(Deal∣mixed)≈0.663 (66.3% of pitches by mixed teams reached a deal) 137.
These rates indicate that mixed teams had the highest deal share, followed by all-women teams, and then all-men teams, despite mixed teams having fewer total deals due to fewer pitches 137.
7.7 Answering the driving question
The driving question asks which sentence best describes the likelihood of a deal when pitching in a late season. Sentence A, which states that 68.8% of late-season pitches reached a deal (P(D∣L)), directly addresses this by using the late-season pitches as the reference class.
Sentence B, which states that 57.3% of deals came from late seasons (P(L∣D)), describes how deals are distributed across seasons, not the likelihood of a deal for a specific pitch in a late season 138.
- Sentence A: P(D∣L)=734505≈0.688. This is the probability of a deal given the pitch is from a late season.
- Sentence B: P(L∣D)=882505≈0.573. This is the probability of a pitch being from a late season given it resulted in a deal 138.
The higher deal rate for late-season pitches (68.8%) compared to the overall deal rate (61.2%) suggests a potential advantage, but this does not imply causation 138.
7.8 Founder's decision: applying Bayes' rule
This section explores a founder's decision-making process using a signal to update probabilities, illustrating Bayes' rule with a practical example. The goal is to determine the most profitable action based on conditional probabilities 139.
- Scenario: A venture sells meal boxes via subscription, offering free trial boxes. One in ten trial customers becomes a subscriber. A signal indicates that 80% of future subscribers open a follow-up email, while 20% of non-subscribers also open it. A phone call to convince a trial customer costs 2 euros, and a subscriber is worth 30 euros 139.
- Decision: The optimal strategy is to call only those customers who opened the email.
- Reasoning: The signal (opening the email) moves the probability of a customer becoming a subscriber from the base rate of 10% to approximately 31% 140.
7.9 Tree of counts for trial customers
A tree diagram helps visualize the counts of customers based on their subscription status and email opening behavior. 139 140.
- Initial distribution: Out of 1,000 trial customers, 100 are subscribers and 900 are not.
- Email openers:
- 80 subscribers open the email (0.80 × 100).
- 180 non-subscribers open the email (0.20 × 900).
- Total openers: 260 customers.
- Email non-openers:
- 20 subscribers do not open the email (100 - 80).
- 720 non-subscribers do not open the email (900 - 180).
- Total non-openers: 740 customers 140.
📝 Out of 1,000 trial customers, 100 are subscribers and 900 are not. Of the 100 subscribers, 80 open the email, and of the 900 non-subscribers, 180 open it, totaling 260 openers 140.
7.10 Conditional probabilities and expected values
Calculating the probability of being a subscriber within each group and the expected value of a call informs the decision 140.
- Probability of subscriber among openers: Approximately 31% (80/260).
- Probability of subscriber among non-openers: Approximately 3% (20/740).
- Expected value of a call to an opener: Approximately 9.23 euros ( (80/260) × 30 euros). This is significantly more than the 2 euro cost.
- Expected value of a call to a non-opener: Approximately 0.81 euros ( (20/740) × 30 euros). This is less than the 2 euro cost 140.
7.11 Finishing a half-worked example: the Bayes tree
This section continues the application of Bayes' rule by working through a new scenario involving an AI classifier for pitches, reinforcing the understanding of conditional probabilities and their interpretation. 141 142.
- Scenario: An AI classifier flags pitches likely to get a deal. The base rate for deals is 20%. The classifier has 90% sensitivity (flags 90% of deals) and a 30% false-positive rate (flags 30% of non-deals).
- Goal: Calculate the probability of a deal given that a pitch was flagged, P(deal | flag) 142.
📝 For 1,000 imaginary pitches, 200 are deals and 800 are non-deals. Of the deals, 180 are flagged, and of the non-deals, 240 are flagged, resulting in 420 total flagged pitches 142.
7.12 Tree of counts for pitches
A tree diagram is used to track the counts of pitches based on deal status and whether they are flagged by the AI 142.
- Initial distribution: Out of 1,000 imaginary pitches, 200 are deals and 800 are non-deals.
- Flagged pitches:
- 180 deals are flagged (0.90 × 200).
- 240 non-deals are flagged (0.30 × 800).
- Total flagged pitches: 420.
- Unflagged pitches:
- 20 deals are not flagged (200 - 180).
- 560 non-deals are not flagged (800 - 240).
- Total unflagged pitches: 580 142.
7.13 Conditional probability calculation
The probability of a deal given a flag is calculated using the counts from the tree 142.
- P(deal | flag): The probability of a deal given a flag is approximately 0.429 (180 flagged deals / 420 total flagged pitches).
- Formula verification: The formula P(deal∣flag)=P(flag∣deal)P(deal)+P(flag∣non-deal)P(non-deal)P(flag∣deal)P(deal) yields 0.90×0.20+0.30×0.800.90×0.20=0.18+0.240.18=0.420.18≈0.429 142.
7.14 Independent exercise
A more accurate classifier with a 5% base rate for deals, 90% sensitivity, and 10% false-positive rate is considered. 142 143.
- Calculation: With 1,000 pitches, there are 50 deals (5% of 1,000). Of these, 45 are flagged (90% of 50). There are 950 non-deals, of which 95 are flagged (10% of 950). The total flagged pitches are 45 + 95 = 140. The probability of a deal given a flag is 45/140, approximately 0.321.
- Interpretation: Even with high sensitivity and a low false-positive rate, the low base rate of deals keeps the share of true flags below one third 143.
7.15 Shark Tank data analysis
This section applies the concepts of conditional probability and independence to real-world data from Shark Tank pitches, analyzing the relationship between deal outcomes and other factors 143.
7.16 Conditional probabilities and independence
The analysis involves calculating conditional probabilities and testing for independence between events 143.
- Events:
- D: An on-air deal.
- L: A late season (Seasons 9 to 16).
- Lc: An early season.
- Verification of Law of Total Probability: P(D)=P(D∣Lc)P(Lc)+P(D∣L)P(L). Using counts, (377/707)(707/1441)+(505/734)(734/1441)=(377+505)/1441=882/1441≈0.612.
- Conditional probability P(L∣D): Among deal records, approximately 57.3% came from late seasons (505/882).
- Comparison with P(D∣L): P(D∣L) is approximately 0.688 (68.8% of late-season pitches received a deal). This differs from P(L∣D) because the conditioning events (and thus the denominators) are different. 144.
- Independence test: P(D∩L)≈0.350, while P(D)P(L)≈0.312. Since these are not equal, D and L are not independent.
- Disjoint events: Events Lc and L are disjoint. They are not independent because P(Lc∩L)=0, while P(Lc)P(L)≈0.25>0. Disjoint events with positive probabilities are always dependent 143.
7.17 Team composition and deal outcomes
The analysis extends to examine the relationship between team composition and the likelihood of securing a deal 143.
- Data:
- 661 pitches with women represented (all-women or mixed) resulted in 428 on-air deals.
- 773 all-men pitches resulted in 449 on-air deals.
- Conditional deal proportions:
- P(deal | women represented) ≈ 428/661 ≈ 0.648 (64.8%).
- P(deal | all-men) ≈ 449/773 ≈ 0.581 (58.1%).
- Interpretation: There is a descriptive difference of about 6.7 percentage points, with pitches featuring women being more likely to secure a deal. However, this difference does not imply causation, as the data source and producers influence pitch selection 143.
7.18 Review questions and interpretation
This section addresses review questions from previous lectures and clarifies common misinterpretations of conditional probabilities, particularly in the context of the Shark Tank data 144.
7.19 Expected value calculation
A review question asks for the expected value of a random variable Y with a given probability mass function (PMF) 144.
- PMF: pY(0)=0.2, pY(1)=0.5, pY(2)=0.3.
- Expected value E[Y]: E[Y]=0(0.2)+1(0.5)+2(0.3)=0+0.5+0.6=1.1.
- Meaning: The expected value is the probability-weighted average of possible values, representing the long-run average over many repetitions. It does not need to be a value the variable can actually take (e.g., Y is never 1.1) 144.
📝 For a random variable Y with pY(0)=0.2, pY(1)=0.5, and pY(2)=0.3, the expected value is E[Y]=0(0.2)+1(0.5)+2(0.3)=1.1 144.
7.20 Interpreting conditional probabilities
A common error is reversing conditional probabilities, leading to incorrect interpretations 144.
- Incorrect statement: "68.8% of deal pitches came from late seasons." This statement incorrectly interprets P(D∣L) as P(L∣D).
- Correct interpretation: P(D∣L)≈0.688 means that 68.8% of late-season pitches received a deal.
- Correct interpretation of reversed conditional: P(L∣D)≈0.573 means that approximately 57.3% of pitches that received a deal came from late seasons.
- AI assistant error: An AI assistant incorrectly stated that "If a pitch got a deal, there is a 68.8% chance that it came from a late season." This confuses P(D∣L) with P(L∣D). The correct answer is that 57.3% of deal pitches came from late seasons.
- Key takeaway: Always clarify which group is in the denominator when interpreting conditional probabilities 144.
7.21 Venture signal analysis
This section prompts reflection on applying conditional probability concepts to a personal venture or a familiar business, focusing on signals and their implications 145.
7.22 Personal venture signal
Consider a venture and a signal received about customers or partners 145.
- Example: A student-run venture selling meal boxes on campus receives clicks on an ad.
- Desired conditional probability: The venture wants to know P(becomes a paying customer∣clicked the ad).
- Required base rate: To trust the signal (clicks), the base rate of buyers among all students who saw the ad is needed. A very low base rate means most clickers still do not buy. 145 146.
7.23 Illustrative tree diagram
An invented example demonstrates how a signal's predictive power can be misleading if the base rate is low 146.
- Scenario: 2% of students who see an ad become buyers. Half of buyers click the ad, and 5% of non-buyers click it.
- Counts for 1,000 students:
- Buyers: 20 (2% of 1,000).
- Non-buyers: 980 (1,000 - 20).
- Buyers who click: 10 (half of 20).
- Non-buyers who click: 49 (5% of 980).
- Total clicks: 59 (10 + 49).
- Result: Only about 17% (10/59) of students who click become buyers. Approximately 83% of clicks come from students who never buy 146.
8. Lecture 5: Joint random variables, covariance, and correlation
8.1 The joint probability mass function
This section introduces the joint probability mass function (PMF) for discrete random variables, which records the probability of every possible pair of values occurring simultaneously. Unlike individual PMFs, the joint PMF captures how the values of two variables are paired.
- Joint PMF definition: For discrete random variables X and Y defined on the same experiment, the joint PMF pX,Y(x,y) gives the probability that X takes the value x AND Y takes the value y, denoted as P(X=x,Y=y).
- Properties of joint PMF: Like any PMF, a joint PMF must satisfy two conditions:
- pX,Y(x,y)≥0 for every possible pair of values (x,y).
- The sum of probabilities over all possible pairs of values must equal 1: ∑x∑ypX,Y(x,y)=1.
- Recovering marginal PMFs: The PMF of a single variable can be recovered from the joint PMF by summing over all possible values of the other variable.
- The marginal PMF of X is pX(x)=∑ypX,Y(x,y).
- The marginal PMF of Y is pY(y)=∑xpX,Y(x,y).
- On a joint probability table, this corresponds to summing along rows to get pX(x) and down columns to get pY(y).
- Marginal vs. Joint PMFs: While the joint PMF contains the marginal PMFs, the reverse is not true; multiple joint PMFs can have the same marginal PMFs. The joint PMF uniquely specifies the pairing of values.
- Conditional PMF: The conditional PMF of X given Y=y, denoted pX∣Y(x∣y), gives the probabilities of the values of X among the outcomes where Y=y. It is calculated as pX∣Y(x∣y)=pY(y)pX,Y(x,y), provided pY(y)>0.
- Conditional PMF interpretation: For a 0/1 variable like the deal indicator, the conditional mean E[X∣Y=y] represents the conditional probability of X=1 given Y=y, which is the conditional rate of deals 152 153 154 155 156.
8.2 Independence of random variables
Two random variables are considered independent if knowing the value of one variable does not change the probabilities of the values of the other variable. This concept extends the idea of independence for events to the entire distributions of the variables.
- Definition of independent random variables: Discrete random variables X and Y are independent if their joint PMF equals the product of their marginal PMFs for every pair of values (x,y): pX,Y(x,y)=pX(x)pY(y).
- Implication of independence: Under independence, the conditional PMF of X given Y=y is equal to the marginal PMF of X, i.e., pX∣Y(x∣y)=pX(x).
- Checking for independence: To prove independence, the product rule must hold for every cell in the joint PMF table. If even one cell does not match, the variables are dependent.
- Dependence vs. Independence: The Shark Tank data shows that the deal indicator and the late-period indicator are not independent, as the observed joint probability of a late-season deal (0.350) differs from the probability expected under independence (0.312). This indicates that deals became more common in later seasons 157.
8.3 Covariance 159 160 161 162
Covariance measures the direction in which two variables move together. It is calculated as the expected value of the product of the deviations of each variable from its mean.
- Covariance definition: For random variables X and Y with means μX=E[X] and μY=E[Y], the covariance is defined as Cov(X,Y)=E[(X−μX)(Y−μY)].
- Interpretation of covariance sign:
- A positive covariance indicates that above-average values of X tend to occur with above-average values of Y, and below-average values tend to occur together.
- A negative covariance indicates that above-average values of X tend to occur with below-average values of Y, and vice versa.
- Calculating covariance: For discrete variables, covariance is calculated by summing the product of deviations (x−μX)(y−μY) weighted by the joint PMF pX,Y(x,y) over all pairs (x,y).
- Computational formula for covariance: An alternative formula is Cov(X,Y)=E[XY]−E[X]E[Y]. This form is often quicker for manual calculation.
- Units of covariance: The units of covariance are the product of the units of X and Y (e.g., dollar-years). This makes its size difficult to compare across different pairs of variables.
- Covariance and independence: If X and Y are independent, then Cov(X,Y)=0. However, the converse is not always true; a covariance of zero does not necessarily imply independence, as it only indicates the absence of a linear association.
| Cell (x, y) | (x - μX)(y - μY) | Probability pX,Y(x, y) | Contribution (x - μX)(y - μY) * pX,Y(x, y) |
|---|---|---|---|
| (0, 0) | (−0.5)(−0.6) = +0.30 | 0.30 | +0.090 |
| (0, 1) | (−0.5)(+0.4) = −0.20 | 0.20 | −0.040 |
| (1, 0) | (+0.5)(−0.6) = −0.30 | 0.10 | −0.030 |
| (1, 1) | (+0.5)(+0.4) = +0.20 | 0.40 | +0.080 |
8.4 Sums of two random variables
Rules exist for calculating the mean and variance of the sum of two random variables, which are useful in various applications, such as analyzing total revenue or combined risk.
- Mean of a sum: The expected value of the sum of two random variables is always the sum of their expected values: E[X+Y]=E[X]+E[Y]. This rule holds regardless of whether the variables are independent.
- Variance of a sum: The variance of the sum of two random variables includes the sum of their variances plus twice their covariance: Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y).
- Variance of a sum for independent variables: If X and Y are independent, their covariance is zero, so the variances simply add: Var(X+Y)=Var(X)+Var(Y).
- Linear combination of random variables: For a linear combination W=a+bX+cY, where a, b, and c are constants, the mean is E[W]=a+bE[X]+cE[Y], and the variance is Var(W)=b2Var(X)+c2Var(Y)+2bcCov(X,Y) 162 163.
8.5 Correlation 163 164 165
Correlation standardizes covariance, making it a unitless measure that ranges between -1 and 1, allowing for the comparison of the strength of linear association between different pairs of variables.
- Correlation definition: The correlation coefficient, denoted by ρXY for random variables or r for sample data, is the covariance divided by the product of the standard deviations of the two variables: ρXY=SD(X)SD(Y)Cov(X,Y).
- Properties of correlation:
- It ranges from -1 to 1: −1≤ρXY≤1.
- It is unitless, as the units of covariance cancel out with the units of the product of standard deviations.
- It remains unchanged when a variable is multiplied by a positive number.
- Interpretation of correlation:
- The sign indicates the direction of the linear association (positive for moving together, negative for moving in opposite directions).
- The magnitude (absolute value) indicates the strength of the linear association, with values closer to 1 indicating a stronger linear relationship and values closer to 0 indicating a weaker one.
- Correlation vs. Covariance: Correlation is preferred for comparing the strength of association between different pairs of variables because it is standardized and unitless, unlike covariance.
- Correlation and linearity: Correlation specifically measures linear association. Variables can be strongly related in a non-linear way (e.g., U-shaped) but have a correlation close to zero.
| Measure | Formula | Range | Units | Interpretation |
|---|---|---|---|---|
| Covariance | Cov(X, Y) = E[(X - μX)(Y - μY)] | (-∞, +∞) | Units of X * Units of Y | Direction and strength of linear association (size is scale-dependent) |
| Correlation | ρXY = Cov(X, Y) / (SD(X) * SD(Y)) | — | Unitless | Direction and strength of linear association (scale-independent) |
8.6 Sample covariance and sample correlation
The sample covariance and sample correlation are used to describe the linear relationship between two observed variables in a dataset. These statistics are calculated from pairs of data points and provide a quantitative measure of how the variables move together.
- Sample covariance (sXY): Measures the average product of deviations from the mean for two variables. sXY=n−11∑i=1n(xi−xˉ)(yi−yˉ).
- Sample correlation (rXY): Standardizes the sample covariance by dividing by the product of the sample standard deviations of the two variables. This results in a unitless measure. rXY=sXsYsXY.
- The sample correlation coefficient, often denoted as r, ranges from -1 to 1 168.
- A correlation near 0 indicates no linear association, but does not imply independence or no relationship 166.
8.7 Point-biserial correlation
When one of the variables is a binary indicator (0/1), the ordinary correlation is specifically called the point-biserial correlation. This is not a new formula but a special name used in certain contexts.
- The point-biserial correlation is calculated using the same formula as the standard sample correlation 166.
📝 The correlation between season and equity offered in the Shark Tank data is approximately -0.42, indicating that pitches in later seasons tend to offer a smaller percentage of equity 166.
8.8 Shark Tank data interpretation
Analysis of the Shark Tank dataset reveals correlations between variables like season, equity offered, and deal status.
- The correlation between season and equity offered is approximately -0.42, indicating a moderate negative linear association. This suggests that pitches in later seasons tend to offer a smaller percentage of equity.
- The correlation between equity offered and the deal indicator is approximately -0.11, indicating a weak negative linear association. This suggests that pitches offering more equity tend to get slightly fewer deals 166.
- The correlation between season and the deal indicator is approximately 0.16, indicating a weak positive linear association. This suggests that deals became more common in later seasons 168.
📝 For a venture selling prepared meals, weekly flyer spending and new sign-ups have a correlation of 0.6. Exam weeks could cause both to be high, as more flyers are distributed and students order more food during exams 169.
8.9 What a correlation can and cannot say
A correlation coefficient provides valuable insights but has limitations. It is crucial to understand what conclusions can and cannot be drawn from it.
-
What a correlation can say:
-
Direction and strength of a linear association in the data.
-
The scale is from -1 to 1, independent of units.
-
What a correlation cannot say:
-
Causation: It does not prove that one variable causes another. A third variable can influence both 167.
-
Curved relationships: It only measures straight-line patterns. Strong curved relationships may have a correlation near zero.
-
Importance for business decisions: It has no units and does not indicate the practical significance of the relationship.
-
Founder's conclusion: A correlation can serve as an initial hint. If acting on it is cheap and reversible, one can act and observe. If it is expensive or hard to undo, testing is recommended 168.
-
Founder's decision: Your venture sells prepared meals. Weekly flyer spending and new sign-ups have a correlation of 0.6 over 30 weeks. Flyers are cheap. Should you double the budget?
- Name one variable that could make both flyer spending and sign-ups high in the same weeks.
- Explain why the correlation of 0.6 alone does not show that flyers bring sign-ups.
- Propose a cheap way to find out whether flyers work, and decide.
Model Answer:
- Exam weeks: More flyers are distributed, and students order more food during exam periods, regardless of flyer effectiveness.
- A correlation measures how two variables move together. Both might be influenced by a third factor (e.g., exam weeks), creating a correlation without direct causation.
- Alternate weeks with and without flyers for a few weeks and compare sign-ups. Since flyers are cheap, act on the correlation and test simultaneously. 169.
📝 A correlation of 0.6 between weekly flyer spending and new sign-ups does not prove that flyers cause sign-ups; exam weeks could be a third variable that increases both flyer distribution and meal orders 169.
8.10 Covariance and correlation in practice
This section revisits the concepts of covariance and correlation through practical examples and exercises, reinforcing understanding of their calculation and interpretation.
8.11 Worked example: Covariance calculation 170
This example demonstrates the step-by-step calculation of covariance for a discrete joint probability distribution.
- Given: A joint PMF for two discrete random variables, X and Y, each taking values 0 or 1.
| X\Y | Y = 0 | Y = 1 | pX(x) |
|---|---|---|---|
| X = 0 | 0.10 | 0.30 | 0.40 |
| X = 1 | 0.40 | 0.20 | 0.60 |
- Step 1: Calculate marginal PMFs and expected values.
- pX(0)=0.40, pX(1)=0.60
- pY(0)=0.50, pY(1)=0.50
- μX=E[X]=0.60
- μY=E[Y]=0.50.
- Step 2: Calculate the products of deviations (x−μX)(y−μY) for each cell.
- For (0,0): (0−0.6)(0−0.5)=(−0.6)(−0.5)=0.30
- For (0,1): (0−0.6)(1−0.5)=(−0.6)(0.5)=−0.30
- For (1,0): (1−0.6)(0−0.5)=(0.4)(−0.5)=−0.20
- For (1,1): (1−0.6)(1−0.5)=(0.4)(0.5)=0.20 170.
- Step 3: Weight each product by its cell probability and sum to find the covariance.
- Contributions:
- (0,0): 0.30×0.10=0.030
- (0,1): −0.30×0.30=−0.090
- (1,0): −0.20×0.40=−0.080
- (1,1): 0.20×0.20=0.040
- Sum: 0.030−0.090−0.080+0.040=−0.10.
- Step 4: Verify with E[XY] and interpret the sign.
- E[XY]=(0×0×0.10)+(0×1×0.30)+(1×0×0.40)+(1×1×0.20)=0.20
- Cov(X,Y)=E[XY]−E[X]E[Y]=0.20−(0.60)(0.50)=0.20−0.30=−0.10
- The negative sign indicates that X=1 tends to occur with Y=0, and X=0 tends to occur with Y=1, more than independence would suggest 171.
8.12 Practice problem: Covariance and correlation 171
This exercise involves calculating marginal PMFs, checking for independence, and computing covariance and correlation for a new joint PMF.
- Given joint PMF:
| X\Y | Y = 0 | Y = 1 | pX(x) |
|---|---|---|---|
| X = 0 | 0.25 | 0.25 | 0.50 |
| X = 1 | 0.15 | 0.35 | 0.50 |
- 1. Marginal PMFs:
- P(X=0)=0.40, P(X=1)=0.50
- P(Y=0)=0.40, P(Y=1)=0.60.
- 2. Independence:
- P(X=1)P(Y=1)=0.50×0.60=0.30.
- P(X=1,Y=1)=0.35.
- Since P(X=1,Y=1)=P(X=1)P(Y=1), X and Y are not independent.
- 3. Covariance (Cov(X,Y)):
- E[X]=0.50, E[Y]=0.60
- E[XY]=(0×0×0.25)+(0×1×0.25)+(1×0×0.15)+(1×1×0.35)=0.35
- Cov(X,Y)=E[XY]−E[X]E[Y]=0.35−(0.50)(0.60)=0.35−0.30=0.05
- The positive sign indicates that X=1 and Y=1 occur together more often than independence would predict.
- 4. Correlation (Corr(X,Y)):
- Var(X)=E[X2]−(E[X])2=0.50−(0.50)2=0.25
- Var(Y)=E[Y2]−(E[Y])2=0.60−(0.60)2=0.24
- Corr(X,Y)=Var(X)Var(Y)Cov(X,Y)=0.25×0.240.05=0.060.05≈0.32
- This correlation is positive and moderate, indicating a tendency for X and Y to increase together.
- 5. Transformation: Define Z=100X.
- Cov(Z,Y)=100×Cov(X,Y)=100×0.05=5.
- Multiplying a variable by a positive constant rescales the covariance by that constant but does not change the correlation.
- 6. Conditional Means:
- E[X∣Y=1]=P(X=1∣Y=1)=P(Y=1)P(X=1,Y=1)=0.600.35≈0.583
- E[X∣Y=0]=P(X=1∣Y=0)=P(Y=0)P(X=1,Y=0)=0.400.15=0.375
- The average of X is higher when Y=1, consistent with the positive covariance.
- 7. Variance of a sum:
- E[X+Y]=E[X]+E[Y]=0.50+0.60=1.10
- Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y)=0.25+0.24+2(0.05)=0.49+0.10=0.59
- The covariance term accounts for the fact that X and Y move together 172.
8.13 Review questions from past lectures
These questions test understanding of concepts from previous lectures, including outcomes, events, and conditional probabilities.
- Question: For a randomly selected Shark Tank pitch record, is "the selected pitch is the record with pitch_id 7" an outcome or an event? What kind of object is the record itself?
- Answer: The record itself is an outcome (a single possible result). The description defines a set containing only that record, which is an event.
- Question: An invented classifier flags pitches likely to get a deal. In the population, the deal base rate is 10%, sensitivity is 70%, and false-positive rate is 20%. For 1,000 pitches, what share of flagged pitches are deals?
- Calculation:
- Assume 1000 pitches: 100 deals, 900 non-deals.
- Flagged deals: 100×0.70=70.
- Flagged non-deals: 900×0.20=180.
- Total flagged pitches: 70+180=250.
- Share of flagged pitches that are deals: 70/250=0.28.
- Answer: 28% of flagged pitches are deals 172.
8.14 Worked exam interpretation: Correlation
This section provides an example of interpreting a correlation coefficient in a real-world context, highlighting its limitations.
- Scenario: The correlation between season and equity offered in the Shark Tank data is -0.416.
- Interpretation:
- Direction and strength: There is a moderate negative linear association between season and equity offered among the 1,441 records.
- Meaning for seasons: Pitches in later seasons tend to offer a smaller ownership percentage compared to earlier seasons. This describes a tendency, not a strict rule for every pitch.
- Units: The correlation has no units.
- Unjustifiable conclusion: The correlation summarizes only the linear association and does not prove that the passage of time caused offers to change 173.
8.15 Worked exam interpretation: Independence and covariance sign 174
This example focuses on determining independence from a joint PMF and interpreting the sign of the covariance.
- Given joint PMF:
| X\Y | Y = 0 | Y = 1 | pX(x) |
|---|---|---|---|
| X = 0 | 0.18 | 0.42 | 0.60 |
| X = 1 | 0.12 | 0.28 | 0.40 |
- Independence:
- Marginal probabilities: P(X=1)=0.40, P(Y=1)=0.70.
- Check cells:
- P(X=0)P(Y=0)=0.60×0.30=0.18 (matches cell)
- P(X=0)P(Y=1)=0.60×0.70=0.42 (matches cell)
- P(X=1)P(Y=0)=0.40×0.30=0.12 (matches cell)
- P(X=1)P(Y=1)=0.40×0.70=0.28 (matches cell)
- Since all four cells match the product of their marginal probabilities, X and Y are independent.
- Independence implies Cov(X,Y)=0 174.
8.16 Correcting AI interpretation
This section addresses an AI's incorrect interpretation of a correlation coefficient, emphasizing the distinction between correlation and causation.
- Scenario: Correlation between offered equity and getting a deal is -0.11. AI claims it proves offering less equity makes sharks say yes and that the variables are independent because the correlation is close to zero.
- Errors:
- Correlation vs. Causation: A correlation describes how variables moved together in the data, not that one causes the other. Later seasons had both lower offers and more deals, which could explain the correlation without direct causation.
- Correlation and Independence: A correlation that is not zero rules out independence. While -0.11 is weak, it is not zero, so the variables are not independent 174.
8.17 Make it yours
This exercise prompts students to apply the concepts of correlation to their own ventures or businesses.
- Task: For your own venture, name two measurable quantities and predict the sign of their correlation, explaining why. Then, name a third variable that could produce that correlation without direct causation.
- Example: For a student-run campus venture selling prepared meals:
- Sentence 1: "Weekly flyer spend and weekly sign-ups should correlate positively, since flyers reach students who have never heard of us."
- Sentence 2: "But exam weeks could produce that correlation on their own: I hand out more flyers in exam weeks, and students order more prepared food in exactly those weeks." 175.
9. Lecture 6: Continuous distributions and the normal model
9.1 Continuous random variables and probability density functions
Continuous random variables can take any real value within an interval, unlike discrete variables which have separate, distinct values. For continuous variables, the probability of any single exact value occurring is zero.
Instead, probability is associated with intervals. This concept is represented by a probability density function (PDF), where the area under the curve over an interval corresponds to the probability of the variable falling within that interval.
The height of the PDF curve at a specific point x represents the probability density, or the rate of probability per unit of x near that value, rather than a direct probability.
- Probability density function (PDF): A curve that is never negative and has a total area of 1 under it.
- The probability that X lies between a and b is the area under the curve between a and b.
- The height of the PDF at x is the probability per unit of x near x.
- A density can exceed 1, as long as the total area remains 1.
- Cumulative distribution function (CDF): For a continuous random variable, the CDF, FX(x)=P(X≤x), represents the area under the density curve to the left of x.
- The CDF is always non-decreasing and ranges from 0 to 1.
- The probability of an interval is the difference between two CDF values: P(a<X≤b)=FX(b)−FX(a).
- For continuous variables, P(a<X<b)=P(a≤X<b)=P(a<X≤b)=P(a≤X≤b) 177 179 181 182.
9.2 The uniform distribution 183 184 185
The uniform distribution is the simplest continuous probability model. It describes a variable where all values within a specified interval [a,b] are equally likely.
The probability of the variable falling into any sub-interval of a given length within [a,b] is constant.
- Uniform distribution notation: X∼U(a,b), where a and b are the parameters defining the interval.
- Support: The interval [a,b] represents the set of all possible values for the random variable.
- Density function: fX(x)=b−a1 for a≤x≤b, and 0 otherwise.
- Properties:
- Mean: E[X]=2a+b
- Variance: Var(X)=12(b−a)2
- Standard Deviation: SD(X)=12b−a
- Probability calculation: For a≤c<d≤b, P(c<X<d)=b−ad−c. This probability depends only on the length of the interval (d−c).
| Parameter | Value/Formula |
|---|---|
| Mean | E[X]=2a+b |
| Variance | Var(X)=12(b−a)2 |
| Standard Deviation | SD(X)=12b−a |
📝 A pitch start time is modeled as X∼U(0,90) minutes. The probability that a pitch starts between minute 30 and minute 48 is calculated as P(30<X<48)=90−048−30=9018=0.20.
9.3 The normal distribution 186 187 188 189 190
The normal distribution is a symmetric, bell-shaped continuous probability distribution that is widely used to model phenomena influenced by numerous small, independent random factors. Its shape arises because many small, additive influences tend to cancel each other out, leading to a concentration of values around the mean.
- Parameters: The normal distribution is defined by two parameters:
- Mean (μ): Determines the center of the distribution, shifting it left or right.
- Standard Deviation (σ): Determines the spread or width of the distribution; a larger σ results in a wider, flatter curve, while a smaller σ results in a narrower, taller curve.
- Notation: X∼N(μ,σ2), where σ2 is the variance.
- Density function: fX(x)=σ2π1exp(−2σ2(x−μ)2).
- Key empirical rules:
- Approximately 68% of the distribution lies within one standard deviation of the mean (μ±σ).
- Approximately 95% of the distribution lies within 1.96 standard deviations of the mean (μ±1.96σ).
| Parameter | Role |
|---|---|
| Mean (μ) | Shifts the distribution left or right, defining its center. |
| Standard Deviation (σ) | Determines the spread of the distribution; larger σ means wider and flatter curve, smaller σ means narrower and taller curve. |
📝 For the equity offered in the Shark Tank file, the mean is 13.2% and the standard deviation is 8.4%. Using a normal model N(13.2,8.42), the probability of an offer being 30% or more is calculated by standardizing 30 to a z-score and finding the area to the right.
9.4 Standardizing and normal probabilities 191 192 193 194
Standardizing a normal random variable transforms it into a standard normal variable with a mean of 0 and a standard deviation of 1. This process allows probabilities for any normal distribution to be calculated using a single set of standard normal probabilities.
- z-score: The z-score of a value x is calculated as z=σx−μ. It indicates how many standard deviations x is away from the mean μ.
- This z-score represents how many standard deviations x is away from the mean μ.
- Standard normal distribution: If X∼N(μ,σ2), then Z=σX−μ∼N(0,1).
- Calculating probabilities: Probabilities for a normal variable X can be found by standardizing X to Z and using standard normal probabilities: P(X≤x)=P(Z≤σx−μ).
- Rules for probabilities:
- Complement rule: P(Z>z)=1−P(Z≤z).
- Symmetry rule: P(Z≤−z)=P(Z>z).
| Rule | Formula |
|---|---|
| Complement Rule | P(Z>z)=1−P(Z≤z) |
| Symmetry Rule | P(Z≤−z)=P(Z>z) |
📝 For a processing time Y∼N(50,100) (so σ=10), the probability P(Y>60) is found by standardizing: z=1060−50=1.0. Then, P(Y>60)=P(Z>1.0)=1−P(Z≤1.0)=1−0.8413=0.1587.
9.5 Quantiles of the normal distribution
Quantiles are values that divide the probability distribution into segments. For a given probability q, the q-quantile is the value xq such that the probability of the random variable being less than or equal to xq is q.
This is the reverse of calculating probabilities from values.
- Quantile definition: For a probability q (between 0 and 1), the q-quantile xq of a distribution is the value such that P(X≤xq)=q.
- Percentile: A percentile is a quantile expressed as a percentage (e.g., the 90th percentile is the 0.90 quantile).
- Calculating quantiles:
- For the standard normal distribution Z∼N(0,1), the q-quantile is denoted zq.
- For any normal distribution X∼N(μ,σ2), the q-quantile xq can be found using the standard normal quantile zq: xq=μ+zqσ.
- Central part of the standard normal: The two values that enclose a central probability (1−α) are ±z1−α/2. For example, for a 95% central part (α=0.05), the boundaries are ±z0.975 195 196 197.
📝 For the processing time model Y∼N(50,100), the 90th percentile (0.90 quantile) is found. The standard normal 0.90 quantile is z0.90=1.2816. The corresponding value in the Y distribution is x0.90=μ+z0.90σ=50+1.2816×10=62.8 minutes.
9.6 Quantiles and central parts of the normal distribution
The normal distribution is a continuous probability model characterized by its mean (μ) and standard deviation (σ). Probabilities for continuous variables are represented by areas under the probability density function (PDF), not by single points.
The quantiles of a normal distribution, like those of any continuous model, can be found using the inverse cumulative distribution function (CDF), often implemented as qnorm() in statistical software 198 199 202.
-
Central part probabilities: Common central probabilities are 90%, 95%, and 99%. These correspond to specific quantile pairs.
-
90% central part: quantiles are approximately -1.645 and 1.645.
-
95% central part: quantiles are approximately -1.960 and 1.960.
-
99% central part: quantiles are approximately -2.576 and 2.576 198 199.
-
General normal model quantiles: For any normal model N(μ,σ2), the central probability lies between μ−z1−α/2σ and μ+z1−α/2σ, where z1−α/2 is the quantile from the standard normal distribution 199 202.
-
Quantiles of a model distribution: A model distribution has the same quantiles as the data it represents.
-
The median is the 0.50 quantile.
-
The quartiles are the 0.25 and 0.75 quantiles 201.
-
Normal distribution median and quartiles: Due to symmetry, the median of a normal distribution equals its mean (μ). The quartiles lie approximately 0.6745 standard deviations (σ) on either side of the mean, forming the range μ±0.6745σ 201.
-
Example: Delivery time promise: A founder needs to promise a delivery time that 90% of orders meet.
-
Question: Which time should be promised?
-
Concept: This requires finding the 90th percentile of the delivery time distribution.
-
Calculation: Using a normal model with mean 28 minutes and standard deviation 6 minutes, the 90th percentile is calculated as μ+z0.90σ=28+1.2816×6≈35.7 minutes.
-
Check: Before promising, the histogram of actual delivery times must be checked. If the data is right-skewed, the normal model may be too optimistic, and the 90th percentile of the actual data should be used instead 202 203.
9.7 Checking the normal model against data
The normal distribution is a model that must be checked against actual data using a histogram. A good fit occurs when the histogram of the data closely resembles the normal curve with the same mean and standard deviation 200 202.
-
Model limitations: The normal model may be a poor fit if the data exhibits skewness, has strict bounds (like 0% or 100%), or shows spikes at round values.
-
The Shark Tank equity offer data, for instance, is strongly right-skewed and has spikes at round percentages, making the symmetric normal curve a poor fit 200 201.
-
Consequences of a poor fit: Using a normal model that does not fit the data can lead to inaccurate probability estimates. For example, the normal model underestimated the proportion of pitches offering 30% or more equity in the Shark Tank data because it missed the long right tail 201 210.
-
When the normal model is useful: Despite potential inaccuracies for raw data, the normal model is highly valuable for describing the sampling distribution of an average, as explained by the central limit theorem. This is a primary reason for its widespread use in statistics 201.
-
Interpreting density: The height of a PDF curve represents probability per unit of width, not probability itself. A density value greater than 1 is possible as long as the total area under the curve (representing total probability) equals 1 203 204 208.
-
Example: Checking the normal model for equity offers:
-
Data: Equity offered in Shark Tank pitches.
-
Model: Normal distribution with mean 13.2% and standard deviation 8.4%.
-
Check: A histogram of the data shows a right-skewed distribution with spikes at round percentages, which the symmetric normal curve fails to capture.
-
Conclusion: The normal model is a poor fit for individual equity offers 200.
9.8 Probabilities and quantiles for continuous variables
For continuous random variables, probabilities are associated with intervals, and these probabilities are calculated as areas under the probability density function (PDF). The PDF's height indicates the density of probability per unit of width 202 204 208.
-
Calculating probabilities:
-
For a uniform distribution U(a,b), the probability of an interval (c,d) within [a,b] is given by b−ad−c 204.
-
For a normal distribution N(μ,σ2), probabilities are found by standardizing the variable to a z-score (z=σx−μ) and using the standard normal CDF (e.g.,
pnorm()in R) 202 205 206. -
Calculating quantiles:
-
Quantiles are found using the inverse CDF. For a normal model, this is typically done with
qnorm()in R 202 205. -
Example: Delivery window probability:
-
Scenario: A supplier delivers between 09:00 and 13:00 (a 240-minute window), and the goods lift is available only from 12:00 to 13:00 (a 60-minute window).
-
Model: Uniform distribution U(0,240) for delivery time in minutes.
-
Question: What is the probability that the delivery arrives during the available lift time?
-
Calculation: The probability is the ratio of the available window to the total delivery window: 60/240=0.25. The density height per minute is 1/240 205 206.
-
Example: Weekly revenue levels:
-
Scenario: Weekly revenue is modeled as N(100,152) in hundreds of euros.
-
Question 1: Which revenue level is exceeded in only 10% of weeks?
-
Concept: This is the 90th percentile (0.90 quantile).
-
Calculation: Using z0.90≈1.2816, the revenue level is 100+1.2816×15≈119.2 hundred euros, or 11,900 euros.
-
Question 2: Between which two revenue levels do the central 90% of weeks lie?
-
Concept: This involves finding the quantiles that leave 5% in each tail (α=0.10, so α/2=0.05). The quantile is z0.95≈1.645.
-
Calculation: The boundaries are 100±1.645×15, which are approximately 75.3 and 124.7 hundred euros (7,530 and 12,470 euros) 205 206.
-
Discrete vs. Continuous Probabilities: For a discrete variable, a single point can have positive probability (e.g., P(X=2)=0.3). For a continuous variable, any single point has zero probability (P(X=x)=0), so P(X<2) is the same as P(X≤2) 207.
9.9 Changing units in continuous models
When units are changed for a continuous variable, the support of the distribution and the density height change, but the probabilities of intervals remain the same 208.
-
Support: The range of possible values for the variable expands or contracts based on the unit conversion. For example, converting minutes to seconds multiplies the interval bounds by 60 208.
-
Density height: The numerical value of the density changes because it represents probability per unit of width. If the unit width decreases (e.g., from minutes to seconds), the density height must increase proportionally to maintain the same area (probability) 208.
-
Probabilities: Probabilities, being areas under the PDF, are invariant to unit changes as long as the interval width is considered in the new units 208.
-
Example: Session timing in seconds:
-
Scenario: Pitch start time is U(0,90) minutes.
-
Conversion: Convert to seconds, so the support becomes U(0,5400) seconds.
-
Density change: The density per minute was 1/90≈0.0111. In seconds, the density becomes 1/5400≈0.000185.
-
Probability: An 18-minute window (1080 seconds) still has a probability of 18/90=0.20 or 1080/5400=0.20 208.
9.10 Exam-style questions and interpretations
Exam-style questions often involve applying concepts of continuous distributions, including calculating probabilities, quantiles, and checking model assumptions 208 209.
-
Example: Parcel weight and order value:
-
Models: Parcel weight X∼U(2,10) kg; Order value Y∼N(80,202) euros.
-
Tasks: Calculate PDF height, probabilities, variance, and quantiles for these models.
-
Key concepts: Uniform distribution properties (PDF, mean, variance), normal distribution properties (standardization, z-scores, CDF, inverse CDF), and the distinction between density and probability 208 209.
-
Example: AI assistant error:
-
Scenario: An AI assistant used a normal model to estimate the proportion of pitches offering 30% or more equity.
-
Error: The AI's calculation was correct for a normal distribution, but the normal model itself was a poor fit for the equity offer data, which is right-skewed.
-
Corrected Answer: The actual proportion in the data (about 5.3%) was significantly higher than the AI's estimate (about 2.3%) due to the model's inaccuracy. This highlights the importance of checking model fit before trusting results 209 210.
-
Interpreting PDF height: A PDF height is not a probability. Probability is the area under the PDF over an interval. A density value only becomes a probability when multiplied by an interval width 209.
10. Tutorial 2: Conditioning, relationships, and the normal model
10.1 Conditional probabilities and Bayes' rule
This section covers calculating conditional probabilities and applying Bayes' rule, using the Shark Tank dataset as an example. The reference class for a conditional probability is the set of outcomes over which the probability is calculated.
-
Conditional probability: The probability of an event occurring given that another event has already occurred.
-
P(A∣B): Probability of event A given event B. The reference class is event B.
-
P(B∣A): Probability of event B given event A. The reference class is event A 213.
-
Bayes' Rule: A formula to update the probability of a hypothesis based on new evidence.
-
P(A∣B)=P(B)P(B∣A)P(A) 214.
-
Law of Total Probability: Used to calculate the probability of an event by summing probabilities over a partition of the sample space.
-
P(A)=∑P(A∣Bi)P(Bi) for a partition {Bi} 214.
10.2 Task 1: Two events, Bayes’ rule, and covariance
This task involves calculating conditional probabilities, applying Bayes' rule, and interpreting covariance using the Shark Tank dataset.
- Conditional Probabilities:
- P(D∣M): Probability of an on-air deal given a modest offer (at most 10% equity offered). The reference class is the 853 pitches with a modest offer.
- P(M∣D): Probability of a modest offer given an on-air deal. The reference class is the 882 on-air deals 215.
- Bayes' Rule Application:
- P(D∣M)=P(M)P(M∣D)P(D) 215.
- Law of Total Probability:
- P(D)=P(D∣M)P(M)+P(D∣Mc)P(Mc) 215.
- Covariance Interpretation:
- Cov(X,Y)=E[XY]−E[X]E[Y] 214.
- The positive covariance of approximately 0.0242 indicates that deals and modest offers occur together slightly more often than they would under independence 215.
- AI Answer Errors:
- Error 1: Stating that a small covariance (0.024) implies a weak association. The magnitude of covariance depends on the units of the variables, not solely on its numerical value.
- Error 2: Claiming correlation shows a share of pitches or implies causation. Correlation measures the strength and direction of a linear relationship, not causation.
- Corrected Answer: Deals and modest offers show a weak positive linear association (r≈0.10). The records do not show that a modest offer causes a deal, as founders choose their offers themselves 215.
📝 If a part fails given it's from the new printer, the probability is P(F∣N)=0.10. If 1,000 parts are made, 400 are from the new printer, and 40 of those fail.
10.3 Task 2: Total probability and Bayes’ rule from given rates
This task uses rates of part failures from two 3D printers to calculate probabilities using the multiplication rule, law of total probability, and Bayes' rule.
- Given Probabilities:
- P(N): Probability a part is from the new printer (0.40).
- P(Nc): Probability a part is from the old printer (0.60).
- P(F∣N): Probability a part fails given it's from the new printer (0.10).
- P(F∣Nc): Probability a part fails given it's from the old printer (0.05).
- The reference class of P(F∣N) is parts from the new printer 216.
- Multiplication Rule:
- P(F∩N)=P(F∣N)P(N)=0.10×0.40=0.04 216.
- Law of Total Probability:
- P(F)=P(F∩N)+P(F∩Nc)=P(F∣N)P(N)+P(F∣Nc)P(Nc)=0.04+0.03=0.07.
- Interpretation: 7% of all parts fail. This overall rate is between the individual failure rates and closer to the old printer's rate because it produces more parts 216.
- Tree Diagram:
- For 1,000 parts: 400 from new, 600 from old.
- New printer: 40 fail, 360 pass.
- Old printer: 30 fail, 570 pass.
- Total failures: 40+30=70.
- Failures from the new printer: 40 217.
- Bayes' Rule Calculation:
- P(N∣F)=P(F)P(F∣N)P(N)=0.070.04≈0.571 217.
- Independence Check:
- P(F∣N)=0.10 and P(F)=0.07. Since P(F∣N)=P(F), the events are not independent.
- Alternatively, P(F)P(N)=0.07×0.40=0.028, which is not equal to P(F∩N)=0.04 217.
- Colleague's Misinterpretation:
- The colleague reversed the condition. The 57.1% refers to the proportion of failed parts that came from the new printer (P(N∣F)), not the proportion of new printer parts that fail (P(F∣N)).
- Correct sentence: The new printer makes 40% of all parts, and 57% of the failed parts come from the new printer 217.
📝 If a part is from the new printer (0.40 probability) and fails (0.10 probability), the joint probability is P(F∩N)=P(F∣N)P(N)=0.10×0.40=0.04.
10.4 Covariance and correlation
Covariance and correlation measure the linear relationship between two variables. Covariance indicates the direction of the linear relationship, while correlation standardizes this measure to be unitless and comparable across different datasets.
10.5 Task 3: Covariance and correlation from the same table
This task uses a joint probability mass function (PMF) for the number of plants and pots in an order to calculate covariance and correlation.
-
Joint PMF Check: The sum of all nine entries in the table is 1, and all entries are non-negative, confirming it is a valid joint PMF 227.
-
Probability Calculations:
- P(X≤2,Y=2): Probability of at most two plants and exactly two pots. This covers cells (1,2) and (2,2). 0.05+0.05=0.10.
- P(X≤2 or Y=2): Probability of at most two plants or exactly two pots. Using the addition rule: P(X≤2)+P(Y=2)−P(X≤2,Y=2)=0.70+0.20−0.10=0.80 227.
- Conditional PMF and Mean:
- Conditional PMF of X given Y=0: Divide the Y=0 column by its sum (0.40). The probabilities are 0.625, 0.25, and 0.125, which sum to 1.
- E[X∣Y=0]=1(0.625)+2(0.25)+3(0.125)=1.5 plants.
- E[X]=1.9 plants.
- Interpretation: Orders without a pot contain, on average, 1.5 plants, which is 0.4 plants fewer than the average of all orders 227.
- Independence Check:
- Cell (1,0): P(X=1,Y=0)=0.25.
- Product of margins: P(X=1)P(Y=0)=0.40×0.40=0.16.
- Conclusion: Since 0.25=0.16, the variables X and Y are not independent. One cell not matching the product rule is sufficient to show dependence 227.
📝 The correlation between creative self-efficacy and creative performance is 0.36, indicating a moderate positive linear association where higher self-efficacy tends to correspond with higher performance ratings.
10.6 Task 4: A normal model in both directions
This task involves calculating probabilities and values from a normal distribution, representing the time teams need to solve an escape room.
- Probability of at most 49 minutes:
- Standardize: z=(49−45)/5=0.8.
- P(Y≤49)=P(Z≤0.8)=0.7881.
- Interpretation: Approximately 79% of teams need at most 49 minutes to solve the room 221.
- Probability between 39 and 49 minutes:
- Standardize: z39=(39−45)/5=−1.2.
- P(39≤Y≤49)=P(−1.2≤Z≤0.8)=P(Z≤0.8)−P(Z≤−1.2).
- Using symmetry, P(Z≤−1.2)=P(Z>1.2)=1−P(Z≤1.2)=1−0.8849=0.1151.
- P(39≤Y≤49)=0.7881−0.1151=0.6730.
- Interpretation: Approximately 67% of teams need between 39 and 49 minutes 221.
- Time limit exceeded by 5% of teams:
- This limit is the 0.95 quantile of the normal distribution.
- Limit = μ+z0.95σ=45+1.645×5=53.225 minutes.
- Interpretation: A time limit of approximately 53.23 minutes would be exceeded by 5% of the teams 221.
- Quantile Interpretation:
- The supplied quantile z0.95=1.645 means that 95% of the values of a standard normal variable are at or below 1.645, and 5% are above it 221.
10.7 After class: Interpreting research paper statistics
This section interprets statistical values from the Shark Tank dataset, focusing on conditional rates and correlations.
-
Deal Rates:
-
Deal rate for one entrepreneur: 0.5608 (56.1%). Reference class: pitches by one entrepreneur.
-
Deal rate for more than one entrepreneur: 0.6825 (68.3%). Reference class: pitches by more than one entrepreneur.
-
Interpretation: Pitches with multiple entrepreneurs had a higher on-air deal rate by 12.2 percentage points. This difference does not imply causation 222.
-
Correlations:
-
cor(season, ask amount)≈0.0417: Almost no linear association between season and the amount asked.
-
cor(ask amount, deal)≈−0.0785: A very weak negative linear association between the amount asked and the deal indicator.
-
Interpretation: Larger asks are associated with slightly fewer deals. However, founders choose their asks, so this does not imply causation. The outcome is a televised deal, not a finalized investment 222.
10.8 Task 5: Conditional means and the sum of two indicators
This task uses the Shark Tank data to calculate conditional means and the variance of the sum of two indicator variables.
- Conditional Means:
- E[X∣Y=1]: Mean deal indicator given a modest offer. Calculated by dividing the joint PMF column for Y=1 by P(Y=1)≈0.5920. Result: ≈0.653.
- E[X∣Y=0]: Mean deal indicator given not a modest offer. Calculated by dividing the joint PMF column for Y=0 by P(Y=0)≈0.4080. Result: ≈0.553.
- Interpretation: Among pitches with a modest offer, 65.3% reached a deal. Among pitches that offered more than 10%, 55.3% did 224.
- Variance of the Sum:
- E[X+Y]=E[X]+E[Y]=0.612+0.592=1.204.
- Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y)=0.237+0.242+2(0.024)≈0.527.
- Interpretation: The variance of the sum is larger than the sum of the variances due to the positive covariance, indicating that deals and modest offers tend to occur together 224.
10.9 Task 6: Independence of events D M
This task verifies the independence of the 'deal' and 'modest offer' events using both conditional probabilities and the product form.
- Independence via Conditioning:
- P(D)≈0.612 (overall deal probability).
- P(D∣M)≈0.653 (deal probability given a modest offer).
- Conclusion: Since P(D∣M)=P(D), the events are not independent. Conditioning on a modest offer changes the probability of a deal 225.
- Independence via Product Form:
- P(D∩M)≈0.387 (observed joint probability).
- P(D)P(M)≈0.612×0.592≈0.362 (product of marginal probabilities).
- Conclusion: Since P(D∩M)=P(D)P(M), the events are not independent 225.
- "Not Independent" vs. Causation:
- The association between a modest offer and a deal in the Shark Tank data does not imply causation because the founders select their offers. Founders who offer less equity might differ in other ways (e.g., venture stage, quality), influencing both the offer and the likelihood of a deal 225.
- Disjoint but Not Independent Events:
- Events M (modest offer) and Mc (offer above 10%) are disjoint because they cannot occur simultaneously. If one occurs, the other is impossible. Disjoint events with positive probabilities are dependent because observing one event makes the other impossible 225.
10.10 Task 7: Read a correlation table from a paper
This task involves interpreting a correlation table from a hypothetical research paper on employee creativity.
| Variable | Mean | SD | 1 | 2 | 3 |
|---|---|---|---|---|---|
| 1. Creative self-efficacy (1 to 7) | 5.10 | 0.90 | — | 0.08 | 0.31 |
| 2. Job tenure (years) | 6.40 | 4.20 | 0.08 | — | 0.05 |
| 3. Supervisor support (1 to 7) | 4.80 | 1.10 | 0.31 | 0.05 | — |
| 4. Creative performance (1 to 7) | 4.20 | 1.00 | 0.36 | 0.12 | 0.28 |
- Correlation between Creative Self-Efficacy and Creative Performance:
- The correlation is 0.36 (row 4, column 1).
- Interpretation: This indicates a moderate positive linear association. Employees with higher self-efficacy tended to have higher creative performance ratings in this sample 226.
- Weakest Linear Association:
- The weakest association is between job tenure and supervisor support, with a correlation of 0.05 226.
- Alternative Explanations for Correlation:
- A third variable, such as working in a creative role, could lead to both higher supervisor support and higher creative performance, creating the observed correlation without direct causation. Alternatively, supervisors might support employees who already perform well 226.
- Limitations of the Table:
- The table describes associations across 240 employees but cannot predict outcomes for an individual employee with certainty. For example, with a correlation of 0.36, many employees with high self-efficacy may still have average performance 226.
10.11 Task 8: Read a joint PMF with three values per variable
This task involves working with a joint PMF for the number of plants and pots in an order, calculating probabilities, conditional means, and checking for independence.
-
Joint PMF Validation: All nine entries are non-negative, and the row sums (0.40, 0.30, 0.30) add up to 1, confirming it's a valid joint PMF 227.
-
Probability Calculations:
-
Conditional PMF and Mean:
- E[X]=1.9 plants.
- Independence Check:
- Cell (1,0): P(X=1,Y=0)=0.25.
10.12 Task 9: Two independent variables
This task involves constructing a joint PMF for two independent variables (soap sales in two shops) and calculating related statistics.
- Joint PMF Construction: For independent variables, each cell's probability is the product of its marginal probabilities.
- Cell (1,1): P(X=1,Y=1)=P(X=1)P(Y=1)=0.5×0.4=0.20.
- The nine entries sum to 1 229.
- Expected Values and Covariance:
- E[X]=0(0.4)+1(0.5)+2(0.1)=0.7.
- E[Y]=0(0.5)+1(0.4)+2(0.1)=0.6.
- E[XY]=∑xyP(X=x,Y=y)=1(1)(0.20)+1(2)(0.05)+2(1)(0.04)+2(2)(0.01)=0.20+0.10+0.08+0.04=0.42.
- Cov(X,Y)=E[XY]−E[X]E[Y]=0.42−(0.7×0.6)=0.42−0.42=0 229.
- Sum of Variables:
- $E[X+Y = E[X + E[Y = 0.7 + 0.6 =
10.13 Stability of total revenue 232
The stability of total revenue depends on the covariance between the revenues of individual products. When revenues are negatively correlated, they tend to offset each other, leading to a more stable total.
Conversely, positive correlation means good days for one product coincide with good days for another, increasing the total revenue's variability.
- Negative covariance: A weak day for one product is a good day for another, causing revenues to partially cancel out, thus stabilizing the total.
- Positive covariance: Good days for one product align with good days for another, leading to greater fluctuations in the total revenue 232.
| Scenario | Revenue Stability | Explanation |
|---|---|---|
| Negative Covariance | More stable total revenue | Revenues partly cancel each other out. |
| Positive Covariance | Less stable total revenue | Good and bad days for products coincide, increasing total variation. |
10.14 Uniform distribution example
A uniform distribution models a variable where all values within a given range are equally likely. The probability of the variable falling within a specific sub-interval is proportional to the width of that sub-interval.
The probability density function (PDF) for a uniform distribution is constant within the range and zero elsewhere.
- Valid density function: A probability density function must never be negative and must have a total area of 1.
- Calculating probability: Probability is represented by the area under the density curve. For a uniform distribution, this is calculated as the width of the interval multiplied by the constant height of the density function.
- Interval outside possible values: When calculating probabilities for intervals that extend beyond the defined range of the uniform distribution, only the portion within the valid range is considered.
- Probability of a single value: The probability of a continuous random variable taking on any single specific value is zero, as a single point has no width and thus zero area under the density curve 233 234.
📝 For a T-shirt printing time X uniformly distributed between 20 and 60 minutes (X∼U(20,60)), the correct height of the density function is 1/(60−20)=0.025 minutes−1. The probability of an order taking between 30 and 45 minutes is P(30≤X≤45)=(45−30)×0.025=0.375 234.
11. Lecture 7: Samples, parameters, and estimators
11.1 Population, sample, and sampling frame
The core idea of quantitative research is to use a sample to understand a larger population. However, it's crucial to distinguish between these sets and the variable of interest.
- Population: The complete set of units about which a question is asked. The number of units in the population is denoted by N.
- Variable: A characteristic of interest that has a value for each unit in the population. Population data is written as x1,…,xN.
- Parameter: A fixed number that describes the population data. Examples include the population mean (μ), population variance (σ2), and population proportion (p). Parameters are typically unknown.
- Sample: A subset of the population that is observed. The number of units in the sample is denoted by n. Sample data is written as x1,…,xn.
- Sample statistic: A quantity calculated from the sample data. Before the sample is drawn, a statistic is a random variable (e.g., Xˉ,S2,p^). After the sample is drawn, it becomes a number (an estimate, e.g., xˉ,s2,p^).
- Sampling frame: The list from which the sample is selected.
- Target population: The larger group that we hope to draw conclusions about.
The relationship between these sets depends on the research question. For instance, a file of recorded pitches might be the target population if the question is about those specific recorded pitches, or it might be a sampling frame if the question is about all entrepreneurs seeking investment 243 244.
11.2 Simple random sampling
Simple random sampling (SRS) is a method where each unit of the population has an equal chance of being selected at every draw.
- Random variable: Before a sample is drawn, the value of each selected unit is a random variable. For a sample of size n, these are X1,X2,…,Xn. This sequence is also called a random sample.
- Observed values: After the sample is drawn, these random variables become observed values, x1,x2,…,xn, also called realized values.
- Purpose of random variables: Working with random variables allows us to describe the behavior of statistics across all possible samples, which is crucial for inferential statistics 244 245.
There are two main ways to draw a sample:
| Method | Description | Properties |
|---|---|---|
| With replacement | A selected unit is returned before the next draw. | Draws are independent; each draw has the same distribution. |
| Without replacement | A unit cannot be selected twice. | Draws are dependent; one draw changes which units are left. |
In practice, samples are almost always drawn without replacement. However, when the sample size n is small relative to the population size N (specifically, if n≤0.10N, the "10% condition"), the draws are treated as independent, simplifying analysis 245 246.
For simple random samples, even when drawn without replacement:
- Each Xi has the same distribution as a single unit drawn randomly from the population.
- E[Xi]=μ and Var(Xi)=σ2 for all i=1,…,n.
- For i=j, the covariance is Cov(Xi,Xj)=−N−1σ2. This negative covariance is usually small when n is a small fraction of N 245 246 247.
📝 For a 0/1 variable, the variance is σ2=p(1−p), where p is the population proportion. The estimated variance of the proportion is p^(1−p^).
11.3 Parameters, estimators, and estimates
When using a sample to learn about a population, it's essential to distinguish between the population parameter and the sample statistic used to estimate it.
| Object | Description | Example (Mean) | Example (Variance) | Example (Proportion) |
|---|---|---|---|---|
| Parameter | A fixed number describing the population. Usually unknown. | μ (population mean) | σ² (population variance) | p (population proportion) |
| Estimator | A rule that calculates a number from a random sample (X₁,..., Xn). It is a random variable. | X̄ = (1/n) Σ Xᵢ | S² = (1/(n-1)) Σ (Xᵢ - X̄)² | P̂ = (1/n) Σ Xᵢ |
| Estimate | The number the rule gives for one observed sample (x₁,..., xn). | x̄ (sample mean) | s² (sample variance) | p̂ (sample proportion) |
- The sums for parameters run over all N units of the population, while sums for statistics run over the n units of the sample 248.
- The sample variance estimator S2 divides by n−1 (degrees of freedom) instead of n 249.
📝 The sample mean (Xˉ) is an unbiased estimator for the population mean (μ) because E[Xˉ]=μ.
11.4 Shortcut formulas for variance
Shortcut formulas can be used to calculate variance, especially when the sum of squared values is known.
- Sample variance shortcut: s2=n−1∑i=1nxi2−nxˉ2
- Population variance shortcut: σ2=N∑i=1Nxi2−Nμ2
These formulas are computationally convenient and yield the same results as the definitional formulas 250 251.
11.5 Variance of a 0/1 variable
For a 0/1 variable, the variance is directly related to its proportion.
- The variance of a single 0/1 value is σ2=p(1−p), where p is the population proportion.
- The estimated variance of the proportion is p^(1−p^), where p^ is the sample proportion.
- The sample variance s2 for the 0/1 values divides by n−1, resulting in s2=n−1np^(1−p^).
This relationship simplifies calculations for proportions 252.
11.6 Unbiased estimators
An estimator is considered unbiased if its sampling distribution is centered on the parameter it is estimating.
- Unbiased estimator: An estimator θ^ of a parameter θ is unbiased if E[θ^]=θ. This means that, on average, across all possible random samples, the estimator will equal the true parameter value.
- Biased estimator: An estimator that systematically overestimates or underestimates the parameter.
The sample mean (Xˉ) and sample variance (S2) are examples of unbiased estimators for the population mean (μ) and population variance (σ2), respectively 253.
11.7 Degrees of freedom for sample variance
The sample variance is an unbiased estimator of the population variance (σ2) when dividing by n−1 instead of n. This correction accounts for the fact that the deviations are measured from the sample mean (Xˉ), not the population mean (μ).
The number of degrees of freedom (n−1) represents the number of pieces of information that can vary freely after the sample mean has been fixed.
- Deviations sum to zero: The sum of deviations from the sample mean is always zero: ∑i=1n(Xi−Xˉ)=0.
- Fixed deviation: Once n−1 deviations are known, the last deviation is determined by this property.
- Degrees of freedom: For a sample variance calculation, there are n−1 degrees of freedom, meaning only n−1 deviations can be freely chosen.
📝 Example Suppose a sample has n=3 observations, and the first two deviations from the sample mean are 2 and −5. To find the third deviation (d3), we use the property that deviations sum to zero: 2+(−5)+d3=0.
Solving for d3 gives d3=3. Thus, for this sample, there are 3−1=2 degrees of freedom 254.
11.8 Sampling methods and their threats 255
The method by which a sample is drawn determines the conclusions that can be drawn from it. Sampling error is the chance difference between an estimate and the parameter, while coverage error occurs when the sampling frame omits part of the target population.
| Method | How units enter | What it supports | Main threat |
|---|---|---|---|
| Simple random sample | Selected by a known random mechanism | Conclusions about the whole frame | Coverage error: units missing from the frame cannot be selected |
| Stratified random sample | Randomly selected within defined groups | Conclusions about the frame, with every group represented | Coverage error, as for the simple random sample |
| Convenience sample | Selected because they are easy to reach | Conclusions about the selected units only | Selection bias: units that are easy to reach differ from the rest |
| Voluntary response sample | Units choose whether to respond | Conclusions about the units that responded only | Selection bias: people with stronger views are over-represented |
| Census of a frame | Every unit in the available frame is recorded | Exact numbers for that frame, with no sampling error | Coverage error |
11.9 Classifying recruitment stories
- Story 2: A startup posts a poll on its Instagram account asking followers to rate a prototype; 412 followers respond.
- Method: Voluntary-response sample.
- Main threat: Selection bias, as followers likely already like the brand, and those with stronger opinions are more likely to reply.
- Story 3: A student emails a survey to friends, family, and two student associations she belongs to.
- Method: Convenience sample.
- Main threat: Selection bias, as contacts that are easy to reach may differ systematically from the wider population.
- Story 4: A researcher numbers all 8,214 firms in the Chamber of Commerce register and selects 300 using a random number generator.
- Method: Simple random sample from the register.
- Supports: Conclusions about the registered firms.
- Main threat: Coverage error, as firms missing from the register cannot be selected 256.
11.10 Random sampling vs. random assignment
Random sampling allows for generalization to the sampling frame, meaning the conclusions drawn from the sample can be applied to the population from which the sample was drawn. Random assignment, on the other hand, is used to establish causal claims by ensuring that treatments are distributed randomly among units.
- Random sampling: Supports generalization to the sampling frame.
- Random assignment: Supports causal comparison of treatments 257.
11.11 Estimators and estimates
An estimator is a rule or formula used to calculate a sample statistic from sample data. Before the data are observed, the estimator is a random variable.
An estimate is the specific numerical value obtained when the estimator is applied to a particular observed sample.
- Estimator: A rule for calculating a statistic from sample data; it is a random variable before data are observed.
- Estimate: The numerical value of an estimator for a specific observed sample 258.
11.12 Random variables before and after the draw
- X1,…,Xn: These are random variables representing the observations before the sample is drawn. They describe every possible sample that could be obtained.
- x1,…,xn: These are the specific numerical values of the observations after the sample has been drawn. They represent the one particular sample that was observed 258.
11.13 Properties of random draws
Draws with and without replacement share properties related to the distribution of individual draws, but differ in their independence.
- Shared properties:
- Each draw has the same distribution, which is the distribution of a single unit drawn at random from the population.
- Each draw has the same expectation (μ) and variance (σ2).
- Draws without replacement: These draws are dependent because selecting one unit changes the pool of available units for subsequent draws 258.
- IID: Stands for independent and identically distributed.
- Treating samples without replacement as IID: A sample drawn without replacement can be treated as IID when the 10% condition holds, meaning the sample size (n) is no more than 10% of the population size (N) (n≤0.10N) 259.
11.14 Sample proportion as a sample mean
A sample proportion (p^) can be viewed as a sample mean because it is calculated from a 0/1 variable. If we code a "success" as 1 and a "failure" as 0, the sum of these values in a sample is the number of successes, and the mean is the proportion of successes.
- 0/1 variable: A variable that takes only two values, typically 0 and 1.
- Sample mean of a 0/1 variable: The sum of the 0s and 1s divided by the sample size, which equals the proportion of 1s (successes).
- Variance of a 0/1 variable: The variance is p(1−p), where p is the population proportion of successes. The estimated variance is p^(1−p^) 259.
11.15 Practice problems and solutions
This section provides practice problems covering concepts from the lecture, including checking conditions, calculating statistics, and interpreting results.
11.16 Practice problem 1: 10% condition
- Scenario: A population of N=20,000 customers and a simple random sample of n=500.
- Check: n=500, N=20,000. 500/20,000=0.025. Since 0.025≤0.10, the 10% condition is satisfied.
- Allowable conclusion: The sample can be treated as independent and identically distributed (IID), even though it was drawn without replacement 261.
11.17 Practice problem 2: Deal proportion in Shark Tank data
- Data: Shark Tank data, N=1,441 pitches.
- Estimator for population deal proportion (p): p^=n1∑i=1nxi, where xi is 1 if a deal was shown, 0 otherwise 260.
- Realised estimate in seed-123 sample: p^=0.64 261.
11.18 Practice problem 3: Fixed vs. random
- Parameter (μ): The population mean is treated as a fixed, though often unknown, value.
- Sample mean (Xˉ): The sample mean is a random variable because it depends on the specific observations in the sample, which vary from one draw to another 261.
11.19 Practice problem 4: Sample mean and SD of description words
- Data: Seed-123 sample (n=100) of Shark Tank pitches. Variable:
description_words. - Calculations:
- Sample mean: Approximately 4.82 words.
- Sample standard deviation: Approximately 1.76 words 261.
11.20 Practice problem 5: Generalizing from a sample
- Explanation: The seed-123 sample of 100 pitches was drawn from televised records, not from all US entrepreneurs. Randomly selecting rows from this specific dataset cannot overcome the gap in coverage, meaning conclusions cannot be reliably generalized to all US entrepreneurs 261.
11.21 Practice problem 6: Degrees of freedom for variance
- Scenario: A sample of five observations (n=5).
- Degrees of freedom: n−1=5−1=4.
- Explanation: Once the sample mean is calculated, four of the five deviations from the mean can vary freely. The fifth deviation is determined because the sum of all five deviations must be zero 261.
11.22 Practice problem 7: Unbiased estimators
- Scenario: Two founders estimate the mean order value of their customers.
- Founder 1: Mean of 50 orders drawn by chance.
- Founder 2: Mean of the 50 largest orders.
- Unbiased estimator: Founder 1's estimator (mean of a random sample) is unbiased.
- Bias: Founder 2's estimator is biased because it systematically overestimates the mean order value by selecting only the largest orders.
- Unbiasedness and one estimate: An unbiased estimator means that, across many samples, the average of the estimates will equal the true parameter. It does not guarantee that any single estimate will be close to the parameter. The next month's estimate from Founder 1 could still miss the true mean 261.
11.23 Practice problem 8: Sample statistics calculation
- Scenario: n=20 orders, sum of values ∑xi=500 euros, sum of squared values ∑xi2=13,260.
- Sample mean (xˉ): xˉ=n∑xi=20500=25 euros.
- Sample variance (s2) using shortcut formula: s2=n−1∑xi2−nxˉ2=20−113,260−20×(25)2=1913,260−12,500=19760≈40 euros2.
- Sample standard deviation (s): s=s2=40≈6.32 euros 261.
11.24 Practice problem 9: Proportion and variance of a 0/1 variable
- Scenario: Random sample of 200 web shop visitors, 50 placed an order. Order coded as 1, no order as 0.
- Estimate of proportion (p^): p^=20050=0.25.
- Estimated variance: The variance of a 0/1 variable is p^(1−p^). p^(1−p^)=0.25×(1−0.25)=0.25×0.75=0.1875.
- Reason for variance form: For a 0/1 variable, the mean of the squared values is equal to the mean itself (since 02=0 and 12=1). The shortcut formula for variance is n−1∑xi2−nxˉ2. When xˉ=p^, ∑xi=np^. Then ∑xi2=∑xi=np^. So, variance = n−1np^−np^2=n−1np^(1−p^). For large n, this is approximately p^(1−p^) 261.
11.25 Sampling distribution of the mean
The sampling distribution of the mean describes the distribution of sample means that would be obtained from repeated random sampling from the same population. The spread of this distribution, measured by the standard deviation of the sample mean, indicates the precision of the sample mean as an estimator of the population mean.
- Parameter vs. sample mean: The population mean (μ) is fixed, while the sample mean (Xˉ) is a random variable that varies across different samples 261.
- Effect of sample size: Larger sample sizes lead to a narrower sampling distribution of the mean, meaning sample means are more likely to be close to the population mean 263.
📝 Example In a simulation, drawing 100 samples of size n=10 from a population with μ=13.21 results in sample means that vary. However, drawing 100 samples of size n=40 results in sample means that are clustered more closely around 13.21, demonstrating that a larger sample size provides a more precise estimate 263.
11.26 Exam-style question interpretation
This section provides an example of how to interpret statistical claims in an exam context, identifying parameters, estimators, and estimates, and critiquing potential flaws in reasoning.
- Scenario: A retailer's loyalty program has 52,000 members. An analyst draws 400 members at random, finding their mean spending in January was EUR 87.40. A claim states: "the average member spends EUR 87.40 per month."
- Parameter: The mean spending in January across all 52,000 members (fixed and unknown).
- Estimator: The sample mean (Xˉ) of the January spending of 400 randomly drawn members.
- Estimate: EUR 87.40, the calculated value for the specific sample.
- Objections to the claim:
- Sampling error: The estimate of EUR 87.40 is subject to sampling error; a different random sample of 400 members would likely yield a different mean. The claim should report uncertainty.
- Generalization over time: The data cover only one month (January). The claim generalizes this to "per month," which is not supported by the data 264.
11.27 Critiquing AI-generated advice
AI assistants can sometimes provide misleading advice if they do not account for the nuances of sampling methods.
- AI's flawed advice: An AI suggested that a 75% purchase rate from 200 Instagram followers could be reliably used to plan sales to all students on campus.
- Correction: A large sample size does not compensate for a biased sampling method. Instagram followers who respond to a poll are likely already fans of the product, leading to an overestimation of interest from the broader student population. A random sample from a comprehensive list of students would provide a more reliable estimate 264.
11.28 Target population, frame, and gap
Understanding the target population, the sampling frame, and the gap between them is crucial for valid statistical inference.
- Target population: The group of individuals or items about which one wants to draw conclusions.
- Sampling frame: The list or source from which units can actually be selected for the sample.
- Gap: The difference between the target population and the sampling frame, representing units that are part of the population but cannot be included in the sample. This gap can lead to coverage error 265.
📝 Example A student-run campus venture wants to learn about all students on campus who buy lunch at least twice a week. The best available list is the venture's own mailing list.
Sampling from this list would overrepresent existing fans and underrepresent students who are not on the mailing list, leading to an overly positive satisfaction estimate for the broader market 265.
12. Lecture 8: Sampling distributions, the central limit theorem, and the t distribution
12.1 The sampling distribution of the sample mean
The sampling distribution of the sample mean describes how the mean of a random sample varies across repeated samples. It is centered at the population mean and its spread is determined by the population standard deviation and the sample size.
Understanding this distribution is crucial for estimating population parameters and quantifying the uncertainty in those estimates.
- Population distribution describes the variation of individual data points within the entire population.
- Sampling distribution describes the variation of a sample statistic (like the mean) across all possible random samples of a given size.
- Realised estimate is the specific value of a sample statistic calculated from one observed sample.
The mean of the sampling distribution of the sample mean (Xˉ) is equal to the population mean (μ). This means that, on average, the sample mean will be an unbiased estimator of the population mean 268.
- Mean of the sample mean: E[Xˉ]=μ 272.
The variance of the sampling distribution of the sample mean is the population variance (σ2) divided by the sample size (n). This indicates that as the sample size increases, the variance of the sample mean decreases, leading to a more precise estimate of the population mean 272.
- Variance of the sample mean: Var(Xˉ)=nσ2 272.
The standard deviation of the sample mean, also known as the standard error when estimated from the sample, measures the typical distance between a sample mean and the population mean. It is calculated as the square root of the variance 272.
- Standard deviation of the sample mean: SD(Xˉ)=nσ 272.
When the population standard deviation (σ) is unknown, it is estimated using the sample standard deviation (s). This estimated standard deviation of the sample mean is called the standard error (SE) 273.
- Standard error of the sample mean: SE(Xˉ)=ns 273.
The precision of a sample mean estimate increases with the square root of the sample size. To halve the typical error of a sample mean, you need four times as many observations 274.
- Square-root rule: To halve the standard deviation of the sample mean, multiply the sample size by 4 274.
An estimator is consistent if, as the sample size increases, the estimate gets closer and closer to the population value. The sample mean is a consistent estimator of the population mean 275.
12.2 The central limit theorem
The Central Limit Theorem (CLT) is a fundamental concept stating that for a sufficiently large random sample, the sampling distribution of the sample mean will be approximately normal, regardless of the shape of the population distribution. This theorem allows us to use normal distribution theory to make inferences about the population mean even when the population is not normally distributed 276.
- Central limit theorem (CLT): For a large random sample (n) of independent and identically distributed (iid) observations with mean (μ) and variance (σ2), the sample mean (Xˉ) is approximately normally distributed 277.
The mean and variance of this approximate normal distribution are the same as those for the exact sampling distribution: E[Xˉ]=μ and Var(Xˉ)=nσ2. The CLT primarily adds information about the shape of the sampling distribution 277.
The approximation of the sampling distribution to a normal distribution improves as the sample size (n) increases. A common rule of thumb is to use a sample size of at least 30, but this can vary depending on the skewness and outliers present in the population distribution 278.
- Normal approximation conditions:
- The population is normally distributed, making Xˉ exactly normal for any n.
- The sample size n is large, making Xˉ approximately normal by the CLT 278.
When the CLT applies, the sample mean can be standardized to a standard normal variable (Z) using the formula 279:
- Standardization for sample mean: Z=σ/nXˉ−μ 279.
The CLT also applies to sample proportions. For a large random sample, the sampling distribution of the sample proportion (p^) is approximately normal with a mean equal to the population proportion (p) and a variance of np(1−p) 279.
- Sampling distribution of sample proportion: p^≈N(p,np(1−p)) 280.
The normal approximation for proportions is considered reasonable when the expected number of successes (np) and failures (n(1−p)) are both at least 10. This is known as the success-failure condition 281.
- Success-failure condition: np≥10 and n(1−p)≥10 281.
When the success-failure condition holds, the sample proportion can be standardized to a standard normal variable (Z) 282:
- Standardization for sample proportion: Z=p(1−p)/np^−p 282.
12.3 The t distribution
When the population standard deviation (σ) is unknown and must be estimated by the sample standard deviation (s), the distribution of the standardized sample mean changes. The statistic T=s/nXˉ−μ follows a t-distribution, which accounts for the additional uncertainty introduced by estimating σ 283.
The t-distribution is a family of distributions that are symmetric around zero and have heavier tails than the standard normal distribution. The shape of the t-distribution depends on the degrees of freedom (df), which are typically equal to n−1 for a sample mean.
As the degrees of freedom increase, the t-distribution approaches the standard normal distribution 284.
-
t-distributions: A family of distributions, each defined by its degrees of freedom (df). They are symmetric around zero and have heavier tails than the standard normal distribution 284.
-
Relationship to standard normal: As df→∞, the t-distribution approaches the standard normal distribution N(0,1) 284.
For a random sample of size n from a normal population, the statistic T=s/nXˉ−μ follows a t-distribution with n−1 degrees of freedom 284.
- Distribution of T for normal population: T=s/nXˉ−μ∼tn−1 284.
| Concept | Description |
|---|---|
| Consistency | The tendency of an estimator to approach the population value as the sample size grows. |
| Central Limit Theorem (CLT) | Describes the shape of the sampling distribution for large samples, indicating it is approximately normal. |
| Sample Mean Equity (n=100) | For n=100 random draws, the sample mean equity is approximately N(13.21, 0.844²). |
12.4 The t distribution
The t distribution is used when the population standard deviation (σ) is unknown and estimated by the sample standard deviation (s). It is similar to the standard normal distribution but has heavier tails, especially at lower degrees of freedom.
This accounts for the additional uncertainty introduced by estimating σ with s 285 286.
- Shape: The t distribution is symmetric around zero, like the standard normal distribution. However, its tails are heavier, meaning it assigns more probability to extreme values.
- Degrees of freedom (df): The shape of the t distribution depends on the degrees of freedom (df), which is typically n−1 for a sample mean. As the degrees of freedom increase, the t distribution approaches the standard normal distribution.
- Quantiles: For a given confidence level, the quantiles of the t distribution are further from zero than those of the standard normal distribution, especially at low degrees of freedom. For example, the 0.975 quantile for a t-distribution with few degrees of freedom is larger than 1.96 285 286.
📝 For a t-distribution with 11 degrees of freedom, the 0.975 quantile is approximately 2.201, which is larger than the standard normal's 1.96. With 99 degrees of freedom, it is 1.984, very close to 1.96 286.
12.5 Standardized sample mean and the t distribution
The t distribution is used for inference about a population mean when σ is unknown. For large sample sizes, the t distribution closely approximates the standard normal distribution 286.
- Standardized sample mean: The standardized sample mean is given by T=s/nXˉ−μ, where Xˉ is the sample mean, μ is the population mean, s is the sample standard deviation, and n is the sample size.
- Relationship to Z: The ratio s/σ introduces additional variability compared to the standard normal distribution. When s is larger than σ, the factor s/σ is greater than 1, moving the standardized mean further from zero. Conversely, when s is smaller than σ, the factor is less than 1, bringing the standardized mean closer to zero.
- Large samples: For large samples, the sample standard deviation s is a precise estimate of σ, and the t distribution closely approximates the standard normal distribution 286 287.
📝 A random sample of 100 pitches from the Shark Tank file had a mean equity offered of 12.76% with a sample standard deviation of 7.71%. The standard error is 7.71/100≈0.77 percentage points. This suggests the population mean is likely within about 0.8 percentage points of 12.76% 287.
12.6 The Central Limit Theorem (CLT)
The Central Limit Theorem (CLT) states that for a large sample size (n), the sampling distribution of the sample mean (Xˉ) is approximately normal, regardless of the population distribution. This allows us to make inferences even when the population is not normally distributed 288.
- Narrower distribution: Averaging observations reduces variability. The sampling distribution of the sample mean is far narrower than the population distribution.
- Predictable shape: The CLT gives this narrower distribution a known shape: approximately normal, even if the population is not.
- Trustworthy averages: The CLT explains why sample averages can be trusted even with skewed populations. Averaging reduces variability, and the CLT provides a predictable shape (normal) for this reduced variability 288.
📝 Figure 8.3 shows simulated sample means for equity offered. With a sample size of 5, the histogram of means is still right-skewed. With a sample size of 100, the histogram is a narrow bell shape around the population mean, closely resembling a normal distribution 293 294.
12.7 Conditions and limitations of the CLT
A large sample size reduces random error but does not correct for selection bias. If the sample is not representative of the population due to how it was drawn, the sample mean will be a biased estimate of the population mean 290 293.
- Selection bias: Sample size does not fix issues with how the sample was selected. If the sampling method is flawed, the sample mean will be a biased estimate of the population mean 290.
- Dependence: Dependence between observations can also threaten the CLT-based approximation.
- Outliers: Extreme outliers can also be a problem, requiring much larger sample sizes for the approximation to work well 293.
📝 A badly selected sample means there is no random mechanism, so neither the CLT nor consistency applies. The sample mean will not estimate the population mean accurately 293.
12.8 Standard deviation of the sample mean vs. standard error
The standard deviation of the observations describes variation among single data points. The standard deviation of the sample mean describes the variation of the sample mean across different samples.
The standard error is an estimate of this standard deviation of the sample mean, calculated from a single sample 291.
- Observations: The standard deviation of the observations (e.g., σ or s) describes the spread of individual data points in the population or sample.
- Sample mean: The standard deviation of the sample mean (σXˉ or SE(Xˉ)) describes how much the sample mean is expected to vary from sample to sample. It is typically smaller than the standard deviation of the observations.
- Standard error: The standard error (SE) is the estimate of the standard deviation of the sample mean, calculated using the sample standard deviation (s) and sample size (n) as SE(Xˉ)=s/n 291.
📝 For a sample of 100 pitches with a standard deviation of 7.71%, the standard error of the mean is 7.71/100≈0.77 percentage points. This estimates the typical variation of the sample mean around the population mean 287 291.
12.9 Sample size and precision
To reduce the standard deviation of a sample mean by a certain factor, the sample size must increase by the square of that factor 289 291.
- Inverse relationship: The standard deviation of the sample mean is inversely proportional to the square root of the sample size (σXˉ∝1/n).
- Scaling factor: To halve the standard deviation of the sample mean, the sample size must increase by a factor of 22=4 289 291 293.
📝 To cut the standard deviation of a sample mean in half, from 6 to 1.5, the sample size must grow by 42=16 times 292.
12.10 Practice problems and solutions 285 286
This section provides practice problems covering the concepts of sampling distributions, the Central Limit Theorem, and the t distribution, along with their solutions 291 292 293 294.
- Problem 1: Calculate E[Xˉ], Var(Xˉ), and SD(Xˉ) for a given sample size and population parameters, naming the rules used.
- Problem 2: Determine the factor by which sample size must grow to reduce the standard deviation of a sample mean from 6 to 1.5.
- Problem 3: Calculate the standard deviation of a sample proportion and check the success-failure condition for a given sample size and assumed proportion.
- Problem 4: Use a table of critical values to find t-distribution quantiles for different degrees of freedom and compare them to the z-quantile.
- Problem 5: Explain why the normal approximation is more convincing for a larger sample size in a simulation of sample means.
- Problem 6: State a threat to the CLT-based approximation that a large sample size alone does not solve.
- Problem 7: Calculate the probability that a sample mean exceeds a certain value and find the standard error of the mean for a given sample 292.
📝 For a sample proportion with p=0.30 and n=100, the standard deviation is 0.30(0.70)/100≈0.0458. The expected counts are np=30 and n(1−p)=70, both at least 10, so the normal approximation is acceptable 291.
| Situation | Distribution of Standardized Sample Mean |
|---|---|
| Population normal, σ known | Z∼N(0,1) |
| Population normal, σ unknown | T∼tn−1 |
| Population not normal, n large | T∼tn−1 (approximately) |
| Degrees of Freedom (df) | 0.975 Quantile of t-distribution |
|---|---|
| df = 4 | 2.776 |
| df = 10 | 2.228 |
| df = 20 | 2.086 |
| df = 120 | 1.980 |
| df = ∞ (Normal) | 1.96 |
13. Lecture 9: Confidence intervals
13.1 Introduction to confidence intervals
A confidence interval provides a range of plausible values for an unknown population parameter, based on sample data. It is constructed using a method that is designed to capture the true parameter in a specified proportion of all possible samples.
This lecture focuses on building and interpreting these intervals for means and proportions, and determining the necessary sample size for a desired level of precision 297 299.
- Point estimate: A single value that serves as the best guess for a population parameter. For the mean equity offered in the Shark Tank data, the point estimate is 12.76%.
- Interval estimate: A range of values constructed to capture the population parameter with a known probability 300.
- Confidence interval: An interval calculated from sample data using a method that captures the population parameter in a chosen share of all samples (e.g., 95%) 299.
- Confidence level: The probability that the method used to construct the interval will capture the true population parameter. Commonly set at 95%, 90%, or 99% 302 304.
13.2 Confidence interval for a mean when population standard deviation (σ) is known
When the population standard deviation (σ) is known, and the population is normal or the sample size (n) is large, the standardized sample mean follows a standard normal distribution. A confidence interval can be constructed using this distribution 301.
The construction of the interval relies on the fact that the standardized sample mean, Z=σ/nXˉ−μ, is standard normal. By defining a probability α (e.g., 0.05), we can find the critical values −z1−α/2 and z1−α/2 that capture the central 1−α area of the standard normal distribution 301.
The inequality −z1−α/2≤Z≤z1−α/2 can be rearranged to isolate the population mean μ, yielding the interval estimator Xˉ±z1−α/2nσ 302.
- Interval estimator: The random interval Xˉ±z1−α/2nσ, which captures the parameter μ with probability 1−α before the data are drawn.
- Confidence interval: The specific interval [l,u] calculated from the data, where l=xˉ−z1−α/2nσ and u=xˉ+z1−α/2nσ 302.
The calculation for the Shark Tank data, assuming σ is known, uses σ=8.44, xˉ=12.76, and n=100. The standard error of the mean is nσ=1008.44=0.844. For a 95% confidence level (α=0.05), z0.975=1.96. The margin of error is 1.96×0.844=1.65. The 95% confidence interval is (12.76−1.65,12.76+1.65)=(11.11,14.41) 303 304.
📝 For a 95% confidence interval with σ known, using xˉ=12.76, σ=8.44, and n=100, the margin of error is 1.96×(8.44/100)=1.65, resulting in the interval (11.11,14.41) 303.
13.3 Confidence interval for a mean when population standard deviation (σ) is unknown
In practice, the population standard deviation (σ) is rarely known. Instead, it is estimated by the sample standard deviation (s).
When σ is unknown, the standardized sample mean T=S/nXˉ−μ follows a t-distribution with n−1 degrees of freedom, provided the population is normal or the sample size is large 304.
The construction of the confidence interval mirrors the case where σ is known, but uses the t-distribution and its critical values. The interval estimator becomes Xˉ±t1−α/2,n−1nS 304.
- t-distribution: A probability distribution that arises when estimating the mean of a normally distributed population in cases where the sample size is small and the population standard deviation is unknown.
- Degrees of freedom (df): A parameter of the t-distribution, typically equal to n−1 for a sample mean 304.
The critical value t1−α/2,n−1 is used instead of z1−α/2. For a 95% confidence interval (α=0.05), a 90% interval (α=0.10), or a 99% interval (α=0.01), the corresponding critical t-values are used 304.
For the Shark Tank data, with xˉ=12.76, s=7.71, and n=100 (df=99), the standard error is s/n=7.71/100=0.771. The critical t-value for a 95% confidence interval with 99 degrees of freedom is t0.975,99≈1.984. The margin of error is 1.984×0.771≈1.53. The 95% confidence interval is (12.76−1.53,12.76+1.53)=(11.23,14.29) 304 306 309 310.
📝 For a 95% confidence interval with σ unknown, using xˉ=12.76, s=7.71, and n=100 (df=99), the margin of error is 1.984×(7.71/100)≈1.53, resulting in the interval (11.23,14.29) 304.
13.4 Margin of error
The margin of error (ME) is a crucial component of a confidence interval, representing half the width of the interval. It quantifies the precision of the estimate at a given confidence level 305.
- Margin of error (ME): The part added to and subtracted from the point estimate to form the confidence interval. For a mean, it is calculated as the critical value multiplied by the standard error: ME=critical value×standard error 305.
The margin of error is influenced by several factors:
- Confidence level: A higher confidence level leads to a larger critical value and thus a wider interval (larger ME).
- Variability of data: Higher variability (larger s or σ) results in a larger standard error and a wider interval.
- Sample size: A larger sample size (n) decreases the standard error (as it's in the denominator), leading to a smaller margin of error and a narrower interval 305.
13.5 Steps for constructing a confidence interval for a mean
To ensure a complete and interpretable confidence interval, follow these five steps 305:
- Formula: State the interval estimator, e.g., Xˉ±t1−α/2,n−1nS. Justify its use (population is normal or n is large).
- Given values: List the sample mean (xˉ), sample standard deviation (s), sample size (n), degrees of freedom (df=n−1), confidence level (1−α), and the corresponding critical value.
- Calculations: Compute the standard error (SE=s/n) and then the margin of error (ME=critical value×SE).
- Interval: State the calculated confidence interval [xˉ−ME,xˉ+ME], including units.
- Conclusion: Interpret the interval in the context of the question. State whether a hypothesized value lies inside or outside the interval and what conclusion can be drawn at the specified significance level (α) 305.
13.6 Example: Confidence interval for customer satisfaction scores
An invented example involves a random sample of n=64 ventures with a mean customer satisfaction score of xˉ=80 points and a sample SD of s=16 points. The industry benchmark is 75 points 306.
- Formula: Xˉ±t1−α/2,n−1nS. Used because the sample is random and n=64 is large.
- Given values: xˉ=80, s=16, n=64, df=63. Confidence level is 95% (α=0.05), so the critical value t0.975,63 is approximately 2.000 (using the closest value on the formula sheet for df=60).
- Calculations: Standard error SE=16/64=16/8=2 points. Margin of error ME=2.000×2=4 points.
- Interval: (80−4,80+4)=(76,84) points.
- Conclusion: With 95% confidence, the mean satisfaction score for all ventures lies between 76 and 84 points. The benchmark of 75 points is outside this interval, allowing us to conclude at the 5% level that the mean score differs from the benchmark and is higher 306.
📝 A 95% confidence interval for customer satisfaction scores with xˉ=80, s=16, and n=64 yields a standard error of 16/64=2 and a margin of error of 2.000×2=4, giving the interval (76,84) points 306.
13.7 Conditions for constructing a confidence interval for a mean
Before calculating a confidence interval for a mean, several conditions must be met to ensure the validity of the results 307:
- Random selection: The sample must be drawn randomly from a clearly defined sampling frame. For the Shark Tank data, the sample of 100 pitches was randomly selected from the 1,441 recorded pitches.
- The 10% condition: If sampling without replacement, the sample size should not exceed 10% of the population size to treat observations as approximately independent. For the Shark Tank data, 100/1441≈0.07, which is less than 0.10.
- Shape and sample size: The population distribution should be approximately normal, or the sample size should be large enough for the Central Limit Theorem to apply. The equity offered data is right-skewed, but with n=100, the t-interval for the mean is still considered reasonable 307.
13.8 Interpreting the confidence level
The confidence level (1−α) refers to the long-run proportion of intervals that would contain the true population parameter if the procedure were repeated many times. It does not imply a probability for a single, specific interval 310 311.
- Correct interpretation: "This interval was produced by a procedure that captures the fixed population mean in about 95% of repeated valid samples.".
- Incorrect interpretation: "There is a 95% probability that the population mean is in my interval." This is incorrect because, after the sample is drawn, the interval endpoints are fixed, and the parameter either is or is not within that specific interval 311.
A simulation of 100 repetitions of the 95% confidence interval procedure for the Shark Tank data showed that 96 of the 100 intervals contained the true population mean of 13.21%. This illustrates that the proportion of captured parameters approaches the confidence level over many repetitions 310 311.
13.9 Determining the required sample size
To achieve a desired precision (margin of error) at a specific confidence level, the required sample size can be calculated. This is done by rearranging the margin of error formula 312.
The formula for the sample size (n) is derived from m=z1−α/2nσ (using z for planning purposes as σ is unknown before the survey): n≥(mz1−α/2×σplan)2 where:
- m is the desired margin of error.
- z1−α/2 is the critical z-value for the chosen confidence level.
- σplan is a planning value for the population standard deviation, often obtained from a pilot study or previous research 312.
Always round the calculated sample size up to the next whole number to ensure the margin of error does not exceed the target 312.
13.10 Example: Sample size for average order value
To determine the average order value within 2 euros at a 95% confidence level, a planning value for the standard deviation of σplan=12 euros is used 312.
- Calculation: n≥(21.96×12)2=(1.96×6)2=11.762≈138.3.
- Result: Rounding up, 139 customers must be surveyed. Surveying 138 customers would result in a margin of error slightly larger than 2 euros 312.
Halving the margin of error to 1 euro requires approximately four times the sample size (554 customers), consistent with the square root relationship 312.
13.11 Confidence interval for a proportion
A proportion can be treated as the mean of a 0/1 variable. The sample proportion (p^) is the sample mean of these indicators 313.
The standard error of the sample proportion is SE(p^)=np(1−p). Since p is unknown, it is estimated by p^, leading to the standard error SE(p^)=np^(1−p^) 314.
The confidence interval for a proportion is constructed as: p^±z1−α/2np^(1−p^) This formula is valid when np^≥10 and n(1−p^)≥10 314.
- Estimate: The sample proportion p^.
- Critical value: A z-value (e.g., z0.975=1.96 for 95% confidence).
- Standard error: SE(p^)=np^(1−p^) 314.
The interval is calculated as [p^−ME,p^+ME], where ME=z1−α/2np^(1−p^) 314.
13.12 Confidence interval for a proportion
The confidence interval for a proportion uses a z-distribution because there is no exact replacement for the unknown population proportion in the standard error formula. The interval is a large-sample approximation, making the z-critical value appropriate.
The condition for using this interval is that both np^ and n(1−p^) must be at least 10.
- Formula: The interval estimator is p^±z1−α/2np^(1−p^).
- This formula may be used if np^≥10 and n(1−p^)≥10.
- Given values: These include the number of successes (x), sample size (n), confidence level, and the critical value (z1−α/2).
- Calculations:
- Standard error: SE=np^(1−p^).
- Margin of error: ME=z1−α/2×SE.
- Interval: The confidence interval is calculated as p^±ME.
- Conclusion: A single sentence in the words of the question, stating whether the hypothesized value falls within the interval. If it falls outside, it can be concluded that the population proportion differs from the hypothesized value at the specified level 315.
Example 9.3: Construct a 95% confidence interval for the proportion of all recorded pitches that end in a deal, given that 64 out of 100 pitches resulted in a deal. Is 0.50 a plausible value 316?
📝
- Formula: p^±z1−α/2np^(1−p^). This may be used because np^=64 and n(1−p^)=36 are both at least 10.
- Given values: n=100, p^=0.64. The confidence level is 95%, so z0.975=1.96.
- Calculations:
- Standard error: 1000.64×0.36=0.002304=0.048.
- Margin of error: 1.96×0.048=0.094.
- Interval: (0.64−0.094,0.64+0.094)=(0.546,0.734).
- Conclusion: With 95% confidence, between about 55% and 73% of all recorded pitches end in a deal. The value 0.50 lies outside the interval, suggesting that the deal proportion is higher than 0.50 at the 5% significance level 316.
13.13 From interval to test
A hypothesis test compares two statements about an unknown population parameter, such as a mean (μ) or a proportion (p), using a random sample to decide between them. The two statements, the null hypothesis (H0) and the alternative hypothesis (H1), cannot both be true.
The decision is either to "reject H0" or "do not reject H0" 318.
- Null hypothesis (H0): This is the default position, stating "there is no effect or difference.".
- Alternative hypothesis (H1): This is the claim the researcher wants to establish, representing the research question or new finding 318.
13.14 Conclusions of a hypothesis test
The two possible conclusions of a hypothesis test do not have the same strength 318.
- Reject H0: The evidence in the data is strong enough to support H1. This is a strong conclusion with a small, pre-determined probability of being wrong.
- Do not reject H0: The data did not provide enough evidence against H0. This is a weak conclusion, as it does not confirm H0 is true and does not limit the probability of failing to reject H0 when it is false 318.
13.15 Hypotheses for the Shark Tank data
The founder's claim is about the population mean (μ) of equity offered 318.
- Null hypothesis: H0:μ=15.
- Alternative hypothesis: H1:μ=15 318.
13.16 The two-sided test
A two-sided test is used when the claim has no direction, meaning the parameter could be wrong in either direction 319.
- Standard two-sided test: H0:μ=μ0 versus H1:μ=μ0, where μ0 is the fixed, known value being tested 319.
13.17 Test statistic when σ is known
When the population standard deviation (σ) is known, the test statistic is the standardized sample mean: Z=σ/nXˉ−μ0. If H0 is true, Z follows a standard normal distribution 319.
Example 9.4: State the hypotheses and calculate the observed value for the advisor's claim that the mean equity offered is 15% 320.
📝
- Hypotheses: H0:μ=15 versus H1:μ=15, where μ is the mean equity offered in all recorded pitches.
- Test statistic: Z=σ/nXˉ−μ0. If H0 is true, it is approximately standard normal because n=100 is large.
- Observed value:
- Denominator: σ/n=8.44/100=0.844.
- zobs=0.84412.76−15=0.844−2.24≈−2.65. The sample mean lies 2.65 standard deviations of the sample mean below the advisor’s figure 320.
13.18 Test statistic when σ is unknown
When the population standard deviation (σ) is unknown, the sample standard deviation (s) replaces σ, and the test statistic is T=s/nXˉ−μ0, which follows a t-distribution with n−1 degrees of freedom if H0 is true 321.
- The observed value of this test statistic is tobs.
- The distribution of the test statistic Z if the null hypothesis is true is the standard normal curve 321.
13.19 What an interval can and cannot tell you
A confidence interval provides a range of plausible values for a population parameter. However, it's crucial to understand its limitations 322.
- Precision vs. Importance: An interval excluding a benchmark value indicates that the estimate is precise enough to distinguish it from the benchmark. It does not imply that the difference is practically important or significant for a decision.
- Causation: A confidence interval does not establish cause-and-effect relationships.
- Selection Bias: A narrow interval does not correct for selection problems; it only describes the sampled data 322.
- Decision Making: Treat every value within the interval as compatible with the sample. To make a decision with one cutoff, checking the interval's ends is sufficient. If the sample is not precise enough, more data may be needed 323.
13.20 Interpreting the Shark Tank interval
The 95% confidence interval for the mean equity offered is (11.23%, 14.29%). This interval does not contain 15% 323.
- Conclusion: At the 5% significance level, it can be concluded that the mean equity offered differs from 15% and is lower.
- Test statistic comparison: With σ known, zobs≈−2.65, indicating the sample mean is 2.65 standard deviations below the advisor's figure 323.
13.21 Founder's decision example
Consider a scenario where the average order value from 25 orders is 9.60 euros with a standard deviation of 2 euros. The break-even point for a kitchen lease is 9 euros per order 323.
📝
- Calculate the 95% confidence interval for the mean order value:
- Standard error: SE=s/n=2/25=0.40 euros.
- Margin of error: ME=t0.975,24×SE=2.064×0.40=0.83 euros.
- Interval: 9.60±0.83=(8.77,10.43) euros.
- Does the interval show that the mean order value differs from 9 euros?: No. The break-even value of 9 euros lies inside the interval, so you cannot conclude that the mean order value differs from 9 euros at the 5% significance level.
- Interval with 100 orders: If n=100, the standard error is 2/100=0.20 euros. The margin of error is t0.975,99×0.20≈1.984×0.20=0.40 euros. The interval is 9.60±0.40=(9.20,10.00) euros. This interval excludes 9.
- Decision: Do not sign the lease yet. Collect more data 324.
13.22 Practice problems and review
This section provides practice problems to reinforce the concepts of confidence intervals and hypothesis testing, along with review questions from previous lectures 324.
13.23 Practice problems
Problems cover calculating confidence intervals for means and proportions, determining sample sizes, stating hypotheses, and calculating test statistics 326 327.
- Task 1: Calculate a 90% confidence interval for mean session length and interpret it regarding a claimed mean of 20 minutes.
- Interval: (17.57, 19.23) minutes.
- Conclusion: The claimed 20 minutes lies outside the interval. At the 10% level, the mean session length differs from 20 minutes and is shorter.
- Task 2: Construct a 95% confidence interval for the proportion of customers recommending a meal box and compare it to a sector benchmark of 25%.
- Interval: (0.227, 0.353).
- Conclusion: The benchmark 0.25 lies inside the interval. At the 5% level, the proportion does not differ from the benchmark.
- Task 3: Determine the required sample size for a desired margin of error for mean repair time at 90% and 95% confidence levels.
- 90% level: 77 repairs.
- 95% level: 110 repairs.
- Task 4: State hypotheses for a two-sided test regarding mean desk use and proportion of recommendations, and calculate the observed test statistic.
- Part a: H0:μ=6 vs H1:μ=6 for mean desk use.
- Part b: tobs=−2.40. The sample mean lies 2.4 standard errors below the advertised value.
- Part c: H0:p=0.25 vs H1:p=0.25 for recommendation proportion.
- Task 5: Explain why an interval excluding a benchmark does not imply practical importance or a specific cause.
- An interval excluding a benchmark indicates sufficient precision to distinguish the parameter from the benchmark, but the practical significance of the difference and its cause require further consideration.
- Task 6: Calculate the sample size needed for a delivery start-up's confidence interval to be at most 1 minute wide 326.
- Sample size: 246 orders 327.
13.24 Worked exam interpretation
Correctly interpreting a confidence interval is crucial 328.
📝 Incorrect statement: "There is a 95% chance that the population mean is in my interval (11.23, 14.29).". Corrected statement: "The interval (11.23, 14.29) was produced by a procedure that captures the fixed population mean in about 95% of repeated valid samples." 328.
13.25 Review questions from past lectures
These questions cover concepts from previous lectures, such as standard error and conditional probability 328.
- Question 1: Calculate the standard error of the sample mean and observe its change with increased sample size.
- Standard error: s/n=24/64=3 euros.
- If n grows to 256, the standard error becomes 24/256=1.5 euros. This demonstrates the square-root rule.
- Question 2: Explain why P(D∣L) and P(L∣D) differ, given conditional probabilities from a 2x2 table.
- The numbers differ because they condition on different events. P(D∣L) divides the joint records by the number of late-season records, while P(L∣D) divides by the number of deal records.
- Question 3: Identify the error in an AI assistant's interpretation of a confidence interval and provide the corrected answer.
- Error: The AI stated that 95% of all pitches offer between 11.23% and 14.29%.
- Correction: The interval is about the mean, not individual pitches. The correct reading is: "The interval was produced by a procedure that captures the mean equity offered in all recorded pitches in about 95% of samples." 328.
13.26 Make it yours
This task encourages applying the concepts to a personal venture or a familiar business 329.
📝 For a student-run meal-prep box venture on campus, churn rate (share of subscribers cancelling) can be analyzed. If the sector benchmark for churn is 25% per term:
- Sentence 1: If a 95% confidence interval for the churn proportion lies entirely below 0.25, one could claim that their customers stay longer than average.
- Sentence 2: If the interval contains 0.25, customer retention would not be presented as an advantage, and the pitch would focus on margins instead 329.
14. Tutorial 3: Sampling and confidence intervals
14.1 Tutorial 3: Sampling and confidence intervals
This tutorial focuses on calculating standard errors and probabilities for sample means and proportions, and constructing confidence intervals. It also covers qualifying conclusions when sampling designs have limitations 330 331.
- Parameter: A value that describes a population.
- Estimator: A rule used to estimate a parameter from a sample; its value is random due to the random nature of the sample.
- Standard deviation of the sample mean: σ/n.
- Standard error of the sample mean: s/n, used when the population standard deviation (σ) is unknown. It is the estimated standard deviation of the sample mean (Xˉ).
- Central Limit Theorem (CLT): Describes the distribution of the sample mean across random samples. For a large random sample, this distribution is approximately normal, even if the population is not normal.
- Confidence interval for a mean: Requires a formula, justification for its use, given values, calculations (standard error, margin of error), the interval with units, and a conclusion in the context of the question.
- Confidence interval for a proportion: Requires a formula, the success-failure condition (np^≥10 and n(1−p^)≥10), given values, calculations, the interval, and a conclusion 330 331.
14.2 Task 1: Population, frame, and claim
This task distinguishes between the population a sample can directly conclude about, and broader target populations. It highlights that a sample from a specific dataset (like Shark Tank pitches) may not represent all applicants or all entrepreneurs 331 332.
- Population: The group about which direct conclusions can be drawn from the sample.
- Frame: The list or source from which the sample is drawn.
- Target population: The broader group the study aims to generalize to 332.
📝 A student randomly selects 100 rows from the Shark Tank file and estimates the mean equity offered. The population about which this sample allows direct conclusions is the 1,441 recorded pitches in completed Seasons 1 to 16 332.
14.3 Task 2: Standard errors and a larger sample
This task involves calculating standard errors for a sample mean and proportion, and observing how these errors change with an increased sample size 332 333.
- Standard error of the mean: Calculated as s/n.
- Standard error of the proportion: Calculated as p^(1−p^)/n.
- Success-failure condition: For proportions, requires that the expected number of successes (np^) and failures (n(1−p^)) are both at least 10 332 333.
If the sample size (n) increases, the standard errors for both the mean and proportion decrease, assuming the sample spread remains similar 333.
The divisor for the sample variance is n−1 because the deviations are measured from the sample mean, and only n−1 of these deviations can vary freely 333.
Standard errors are used because the population values (σ and p) are unknown and are replaced by sample estimates (s and p^). A standard error is an estimated standard deviation of an estimator 333.
14.4 Task 3: The exact normal case
This task explores probabilities related to a single observation and a sample mean when the population is normally distributed 334 335.
- If the population is normal, the sample mean (Xˉ) is exactly normal for any sample size (n).
- The standard deviation of the sample mean is σ/n 335.
The probability for a single candle burning less than 36.4 hours differs from the probability for the mean burn time of 9 candles because the mean varies less than individual observations 335.
14.5 Task 4: A proportion through the CLT
This task calculates the standard deviation of a sample proportion and approximates probabilities using the Central Limit Theorem (CLT) when the sample size is large 335 336.
- Standard deviation of the sample proportion: p(1−p)/n.
- Success-failure condition: np≥10 and n(1−p)≥10 335.
- The CLT allows approximating the sampling distribution of the sample proportion (P^) as normal when the sample size is large enough 336.
A low probability for a sample result suggests that the observed outcome would be surprising if the population parameter were true 336.
14.6 Task 5: A confidence interval for a mean
This task involves constructing and interpreting confidence intervals for a population mean using sample data, considering both 95% and 99% confidence levels 336 337 338.
A complete answer for a confidence interval for a mean includes:
- Formula: Xˉ±t1−α/2,n−1nS. This formula may be used if the population is normal or if the sample size (n) is large.
- Given values: Sample mean (xˉ), sample standard deviation (s), sample size (n), degrees of freedom (df=n−1), confidence level (α), and the critical t-value (t1−α/2,n−1).
- Calculations: Standard error (s/n) and margin of error (t1−α/2,n−1×SE).
- Interval: (xˉ−ME,xˉ+ME).
- Conclusion: Interpretation of the interval in the context of the question, stating the confidence level and whether a claimed value lies inside or outside the interval 338.
- A higher confidence level leads to a wider interval because a larger critical value is needed to capture more possible sample outcomes.
- Conclusions from confidence intervals must specify the confidence level used 338.
14.7 Task 6: A confidence interval for a proportion
This task focuses on constructing and interpreting a confidence interval for a population proportion, including checking conditions and interpreting the results in context 339 340.
A complete answer for a confidence interval for a proportion includes:
- Formula: P^±z1−α/2nP^(1−P^). The 10% condition (sample size is at most 10% of the population) should be checked first if sampling without replacement. The success-failure condition (nP^≥10 and n(1−P^)≥10) must also hold.
- Given values: Sample proportion (p^), sample size (n), confidence level (α), and the critical z-value (z1−α/2).
- Calculations: Standard error (P^(1−P^)/n) and margin of error (z1−α/2×SE).
- Interval: (P^−ME,P^+ME).
- Conclusion: Interpretation of the interval in context, stating the confidence level and whether a claimed value lies inside or outside the interval 340.
- A sample estimate should not be treated as the exact population rate; a confidence interval provides a range of plausible values.
- The standard deviation of the sample proportion (p(1−p)/n) uses the unknown population proportion (p), while the standard error uses the sample proportion (p^) as an estimate 340.
14.8 Task 7: A sample size for a target margin of error
This task involves calculating the required sample size to achieve a specific margin of error for a confidence interval, considering different confidence levels and margin widths 341 342.
The formula for sample size (n) needed for a target margin of error (m) is: n≥(mz1−α/2σ)2 where σ is the population standard deviation (or a planning value) and z1−α/2 is the critical z-value for the desired confidence level 342.
- A smaller margin of error requires a larger sample size.
- A higher confidence level requires a larger sample size for the same margin of error.
- The margin of error is half the total width of the confidence interval 342.
The planning value for σ is an estimate; if the true σ is larger, the achieved margin of error will be larger than planned 342.
📝 To estimate the mean visit time with a margin of error of at most 5 minutes at the 95% level, with a planning value for the standard deviation of 28 minutes, the required sample size is n≥(51.960×28)2≈121 visits 342.
14.9 Individual practice
This section provides practice problems covering standard errors, confidence intervals, and probability calculations for both means and proportions, as well as sample size determination 343 344 345.
- Standard error of the mean: σ/n (population SD) or s/n (sample SD).
- Standard error of the proportion: p(1−p)/n (population proportion) or p^(1−p^)/n (sample proportion).
- Success-failure condition: np≥10 and n(1−p)≥10 for proportions.
- CLT: For a large sample, the sample mean's distribution is approximately normal.
- Sampling uncertainty vs. selection bias: Sampling uncertainty refers to random variation between samples, while selection bias arises from an unrepresentative sampling frame or method 344.
- A claimed value outside a 95% confidence interval suggests the parameter differs from the claim at the 5% level. A value inside means we cannot conclude it differs 345.
14.10 Task 8: One pitch versus one mean
This task compares the probability of a single observation exceeding a value versus the probability of a sample mean exceeding that same value, using the CLT for the sample mean 346 347.
- The CLT justifies using a normal distribution for the sample mean (Xˉ) when the sample size is large, even if the population distribution is skewed.
- The standard deviation of the sample mean is σ/n 346 347.
A sample mean varies less than a single observation, making extreme values less likely for the mean 347.
14.11 Task 9: The CLT for skewed order values
This task applies the CLT to calculate the probability of a sample mean exceeding a certain value when the underlying population distribution is skewed 347 348.
- When the population is not normal but the sample size (n) is large, the CLT approximates the distribution of the sample mean (Xˉ) as normal.
- The standard deviation of the sample mean is σ/n 348.
A small sample size from a non-normal population does not allow for the exact normal case or CLT approximation for the sample mean 348.
14.12 Task 10: Reproduce the realised sample
This task involves reproducing specific sample statistics from a given dataset using a specified seed, demonstrating the reproducibility of random sampling 348 349.
- Parameter: The population mean or proportion.
- Estimator: The sample statistic used to estimate the parameter (e.g., Xˉ for population mean, P^ for population proportion).
- Estimate: The calculated value of the estimator from a specific sample 349.
The interquartile range (IQR) measures the spread of the middle 50% of the data 349.
A different random seed selects a different random sample, leading to different sample statistics, including the IQR 349.
14.13 Alarm value for sample means
The tutorial explores setting an alarm value for a filling machine that dispenses granola. The machine aims to fill bags with 250 grams, but there is variability.
An alarm is triggered if the sample mean weight exceeds a certain threshold, indicating a potential issue with the machine. This threshold is set such that only 5% of hourly samples will trigger the alarm when the machine is functioning correctly 350.
The problem involves calculating the distribution of the sample mean and determining the specific alarm value. It also compares the effectiveness of using a sample mean versus individual bag weights for detecting deviations 350.
14.14 Distribution of the sample mean
When the population is normally distributed, the sample mean also follows a normal distribution. The mean of the sample mean distribution is the same as the population mean, and its standard deviation is the population standard deviation divided by the square root of the sample size 350.
- Population mean: μ=250 grams.
- Population variance: σ2=42 grams2.
- Sample size: n=16 bags.
- Distribution of sample mean: Xˉ∼N(250,42/16).
- Standard deviation of sample mean: SD(Xˉ)=42/16=1 gram 350.
14.15 Calculating the alarm value
The alarm value is determined by finding the 0.95 quantile of the sample mean distribution. This value represents the upper limit such that 95% of sample means will fall below it when the machine is operating correctly 350.
- Alarm threshold: a.
- Condition for alarm: Xˉ>a.
- Probability of alarm: P(Xˉ>a)=0.05.
- 0.95 quantile of sample mean: a=250+1.645×1=251.65 grams 350.
The alarm value is set at 251.65 grams. This means if the average weight of 16 bags exceeds 251.65 grams, the machine will be checked 350.
14.16 Comparison with single bags
Using the mean of multiple bags for monitoring is more sensitive to changes than using individual bags. A larger sample size reduces the standard deviation of the sample mean, making it easier to detect smaller deviations from the target value 350.
- Alarm value for a single bag: 250+1.645×4=256.58 grams.
- Comparison: Single bags vary four times more than the mean of 16 bags.
- Sensitivity: The mean of 16 bags detects changes in the filling machine much earlier.
- Percentage shift: The alarm value for the mean is about 0.6580% above the target weight 350.
The alarm value for a single bag would be 256.58 grams, which is significantly higher than the alarm value for the sample mean. This indicates that the mean of 16 bags provides a more precise and timely alert for machine malfunctions 350.
| Parameter | Value |
|---|---|
| Population mean (μ) | 250 grams |
| Population variance (σ2) | 42 grams2 |
| Sample size (n) | 16 bags |
| Standard deviation of sample mean (SD(Xˉ)) | 1 gram |
| Alarm value for sample mean (a) | 251.65 grams |
| Alarm value for single bag | 256.58 grams |
📝 A founder sells granola in bags of 250 grams. The filling machine puts grams into one bag. Every hour she weighs a random sample of 16 bags and calculates the sample mean Xˉ. She wants an alarm value a: she checks the machine when Xˉ>a. When the machine works as described, only 5% of the hourly samples may give an alarm. The 0.95 quantile of Xˉ∼N(250,42/16) is a=251.65 grams 350.
15. Lecture 10: Testing decisions, errors, and power
15.1 Start with a founder’s question
This section introduces the core concepts of hypothesis testing, focusing on how to make decisions based on data and the potential for errors. It sets up the framework for hypothesis testing, including defining hypotheses and the decision rule 351 353.
- Hypothesis testing is a statistical method used to make decisions about a population based on sample data.
- Decisions based on data can lead to two types of errors: acting when you should not, or not acting when you should.
- The goal is to determine how far a sample statistic must be from a claimed population value before rejecting the claim 351.
15.2 Shark Tank data: Equity offered
An advisor claimed that founders offer 15% of their company on average. A sample of 100 pitches showed a mean equity offer of 12.76%. This scenario is used to illustrate hypothesis testing 352 353.
- Null hypothesis (H0): The population mean equity offered is 15% (μ=15).
- Alternative hypothesis (H1): The population mean equity offered is not equal to 15% (μ=15).
- The population standard deviation (σ) is known to be 8.44 percentage points 353.
- The sample mean (xˉ) is 12.76% from a sample size (n) of 100.
- The standard deviation of the sample mean is calculated as σ/n=8.44/100=0.844.
- The observed test statistic (zobs) is calculated as (xˉ−μ0)/(σ/n)=(12.76−15)/0.844=−2.65 352 354.
📝 The null hypothesis is H0:μ=15, and the alternative is H1:μ=15. The sample mean equity offered is 12.76% from a sample of 100 pitches, with a population standard deviation of 8.44%. The test statistic is zobs=(12.76−15)/(8.44/100)=−2.65. 352
15.3 A decision rule with an unknown constant
A decision rule for a two-sided test rejects the null hypothesis (H0) if the absolute value of the test statistic (∣zobs∣) is greater than or equal to a constant (k). This constant (k) determines the rejection region 355.
- The test statistic follows the standard normal distribution if H0 is true.
- The rejection region consists of two parts: values at or below −k and values at or above k.
- The choice of k is crucial: a small k leads to frequent rejections, while a large k leads to infrequent rejections 355.
| Test Statistic Condition | Decision |
|---|---|
| ∣zobs∣≥k | Reject H0 |
| ∣zobs∣<k | Do not reject H0 |
📝 A two-sided test rejects the null hypothesis (H0) if the absolute value of the test statistic (∣zobs∣) is greater than or equal to a constant (k). For example, if k=1.96, we reject H0 if ∣zobs∣≥1.96. 355
15.4 Type I error and power
This section defines the two types of errors that can occur in hypothesis testing: Type I error and Type II error. It also introduces the concept of the significance level (α) as a control for Type I errors 356.
- Type I error: Rejecting the null hypothesis (H0) when it is actually true. This is a false alarm.
- Type II error: Not rejecting the null hypothesis (H0) when the alternative hypothesis (H1) is true. This is a missed difference 356.
| Reality | Decision: Reject H0 | Decision: Do not reject H0 |
|---|---|---|
| H0 is true | Type I error | Correct decision |
| H1 is true | Correct decision | Type II error |
15.5 Significance level (α)
The significance level (α) is the maximum allowable probability of a Type I error. It is fixed before data analysis.
Common choices for α are 0.05, 0.10, and 0.01 356.
- Fixing α controls the rate of false alarms.
- A test at α=0.05 will reject true null hypotheses at most 5% of the time.
- "Reject H0" is considered a strong conclusion due to the controlled risk of a Type I error 356.
15.6 Choosing the critical value (k)
The critical value (k) is determined by the chosen significance level (α). For a two-sided test, the rejection region is split into two tails, each with an area of α/2 357.
- If H0 is true, the test statistic (Z) follows the standard normal distribution.
- The probability of a Type I error is P(∣Z∣≥k).
- Setting P(∣Z∣≥k)=α means P(Z≥k)=α/2.
- The critical value k is the (1−α/2) quantile of the standard normal distribution, denoted as z1−α/2 357.
| Significance Level (α) | Area in Each Tail (α/2) | Critical Value (k = z₁₋α/₂) | Rejection Region |
|---|---|---|---|
| 0.05 | 0.025 | 1.960 | ∣zobs∣≥1.96 |
| 0.01 | 0.005 | 2.576 | ∣zobs∣≥2.576 |
| 0.10 | 0.050 | 1.645 | ∣zobs∣≥1.645 |
15.7 The five steps of a test
Hypothesis testing is systematically performed in five steps. These steps ensure a consistent and logical approach to making decisions based on data 358.
15.8 Steps for a test with σ known
This outlines the five steps for a two-sided test of a mean when the population standard deviation (σ) is known 358.
- Hypotheses: State H0:μ=μ0 versus H1:μ=μ0. State the significance level α.
- Test statistic: Calculate Z=(xˉ−μ0)/(σ/n). This statistic follows the standard normal distribution if H0 is true.
- Critical value and rejection region: Reject H0 if ∣zobs∣≥z1−α/2.
- Observed value: Calculate zobs from the sample data.
- Conclusion: State "Reject H0" or "Do not reject H0", and interpret the decision in the context of the problem 358.
15.9 Example: Advisor's figure with σ known
This example applies the five steps to the Shark Tank data, assuming the population standard deviation is known 359.
- Hypotheses: H0:μ=15 versus H1:μ=15, with α=0.05. μ is the mean equity offered.
- Test statistic: Z=(xˉ−15)/(8.44/100)=(xˉ−15)/0.844. Since n=100 is large, Z approximately follows the standard normal distribution if H0 is true.
- Critical value and rejection region: For α=0.05, z1−α/2=1.96. Reject H0 if zobs≤−1.96 or zobs≥1.96.
- Observed value: zobs=(12.76−15)/0.844=−2.65.
- Conclusion: Since −2.65≤−1.96, the observed value lies in the rejection region. Reject H0. At the 5% significance level, we conclude that the mean equity offered differs from 15% 359.
15.10 Test with unknown σ: The t-distribution
When the population standard deviation (σ) is unknown, it is replaced by the sample standard deviation (s). This leads to the use of the t-distribution 359 360.
- The test statistic becomes T=(xˉ−μ0)/(s/n) 359.
- If the population is normal, T follows the t-distribution with n−1 degrees of freedom (tn−1) if H0 is true.
- If the population is not normal but n is large, T approximately follows the standard normal distribution. The t-distribution is used in both cases for consistency.
- The critical value is found from the t-distribution: t1−α/2,n−1 360.
| Condition | Test Statistic | Distribution if H0 true | Critical Value |
|---|---|---|---|
| Population normal, σ known | Z=σ/nxˉ−μ0 | Standard Normal | z1−α/2 |
| Population normal, σ unknown | T=s/nxˉ−μ0 | tn−1 | t1−α/2,n−1 |
| Population not normal, n large, σ unknown | T=s/nxˉ−μ0 | Approx. Standard Normal (or tn−1) | t1−α/2,n−1 (or z1−α/2) |
15.11 Steps for a complete answer
A complete answer to a hypothesis testing question includes all five steps, clearly presented 361.
- Hypotheses: State H0 and H1 in symbols and words, and state the significance level α.
- Test statistic: Provide the formula and its distribution under H0, including any conditions.
- Critical value and rejection region: State the critical value(s) and the condition for rejecting H0.
- Observed value: Calculate the test statistic using sample data.
- Conclusion: State whether H0 is rejected or not rejected, and interpret the result in the context of the problem 361.
15.12 Example: Advisor's figure with s and t
This example re-evaluates the Shark Tank data using the t-distribution because the population standard deviation is unknown 361 362.
- Hypotheses: H0:μ=15 versus H1:μ=15, with α=0.05.
- Test statistic: T=(xˉ−15)/(s/100). With n=100, T approximately follows the t99 distribution if H0 is true.
- Critical value and rejection region: For α=0.05 and df=99, t0.975,99≈1.984. Reject H0 if tobs≤−1.984 or tobs≥1.984.
- Observed value: The sample standard deviation s=7.71, standard error se=0.771. tobs=(12.76−15)/0.771=−2.91.
- Conclusion: Since −2.91≤−1.984, the observed value lies in the rejection region. Reject H0. At the 5% significance level, we conclude that the mean equity offered differs from 15% 362.
15.13 Example: Small sample from a normal population
This invented example demonstrates a t-test for a small sample size from a normally distributed population 362.
- Hypotheses: H0:μ=250 versus H1:μ=250, with α=0.05. μ is the mean weight of all bags.
- Test statistic: T=(xˉ−250)/(s/16). Since the population is normal, T follows the t15 distribution if H0 is true.
- Critical value and rejection region: For α=0.05 and df=15, t0.975,15=2.131. Reject H0 if tobs≤−2.131 or tobs≥2.131.
- Observed value: The sample mean xˉ=252.4 grams, sample standard deviation s=4.8 grams. Standard error se=4.8/16=1.2 grams. tobs=(252.4−250)/1.2=2.00.
- Conclusion: The observed value 2.00 falls between −2.131 and 2.131. Therefore, we do not reject H0. At the 5% significance level, we cannot conclude that the mean weight of all bags differs from 250 grams 363.
📝 For a sample of 16 bags of coffee, the mean weight is 252.4 grams and the sample standard deviation is 4.8 grams. Assuming the weights are normally distributed, the test statistic T=(252.4−250)/(4.8/16)=2.00, which follows a t15 distribution. 362
15.14 The confidence interval and the test give the same decision
For a two-sided test of a mean, the decision reached by the hypothesis test is the same as the conclusion drawn from the confidence interval 363 364.
- A two-sided test at level α rejects H0 if and only if the (1−α)×100% confidence interval does not contain μ0.
- Conversely, the test does not reject H0 if and only if the confidence interval contains μ0.
- The confidence interval provides more information than just the decision, including the plausible range of the parameter and the direction of the difference 363.
| Test Decision | Confidence Interval Conclusion |
|---|---|
| Reject H0 at level α | Does not contain μ0 |
| Do not reject H0 at level α | Contains μ0 |
15.15 Test question answered with an interval
When a question asks to use a confidence interval to test a value, construct the interval and conclude based on whether the value falls within it 364.
- Given: A 95% confidence interval for a population mean is (13.6, 18.8). The value under test is μ0=15.
- Question 1: Does this interval contain 15? Yes, 15 is within (13.6, 18.8).
- Test decision: Since the interval contains 15, the test at the 5% level does not reject H0.
- Conclusion: The data are compatible with μ=15. We cannot conclude that μ is exactly 15. "Do not reject" does not mean "accept" 364.
15.16 The p-value
The p-value provides a continuous measure of the evidence against the null hypothesis, representing the smallest significance level at which the null hypothesis would be rejected 365.
- p-value: The smallest significance level (α) at which H0 is rejected with the observed data.
- For a two-sided test, it is the probability of observing a test statistic at least as extreme as the one calculated, assuming H0 is true.
- p=P(∣T∣≥∣tobs∣), where T follows the appropriate distribution (tn−1 or N(0,1)) 365.
15.17 Calculating the p-value
The p-value is calculated as twice the area in one tail of the distribution, beyond the absolute value of the observed test statistic 365 366.
- For the Shark Tank data with s, tobs=−2.91. The p-value is 2×P(T≥∣−2.91∣)=2×P(T≥2.91) with df=99.
- The calculated p-value is approximately 0.0045 365.
- If H0 were true, a sample mean this far from 15 would occur in about 0.45% of random samples 366.
| Test Statistic | p-value Calculation | p-value |
|---|---|---|
| tobs=−2.91 | 2×P(T≥∣−2.91∣) with df=99 | 0.0045 |
15.18 Interpreting the p-value
The p-value is a measure of surprise; a smaller p-value indicates stronger evidence against the null hypothesis. It is crucial to understand what a p-value is and is not 366 367.
- Decision rule: Reject H0 if p≤α.
- For the advisor's test, p=0.0045. Since 0.0045≤0.05 and 0.0045≤0.01, H0 is rejected at both the 5% and 1% levels 366.
- The p-value is not the probability that H0 is true.
- The p-value is not the probability that the result is due to chance; it is calculated assuming H0 is true.
- A small p-value does not automatically imply the effect size is large or in a specific direction.
- A significant p-value does not indicate the cause of the observed difference 367.
15.19 Correcting common p-value misinterpretations
Four common sentences misinterpreting p-values are corrected to reflect their accurate meaning 368.
- Incorrect: "There is only a 0.45% probability that the mean equity offered really is 15%." Correct: "If the mean equity offered were exactly 15%, a sample mean at least this far from 15 would occur in about 0.45% of random samples of 100 pitches.".
- Incorrect: "The result has a 0.45% probability of being due to chance." Correct: "If chance alone were at work, a difference this large would occur in about 0.45% of random samples.".
- Incorrect: "Such a tiny p-value shows that the mean equity offered is far below 15%." Correct: "The mean equity offered is estimated at 12.76%, plausibly between 11.2% and 14.3%.".
- Incorrect: "The tiny p-value proves that founders have become more careful in what they offer." Correct: "The mean equity offered among the pitches in the file differs from 15%." 368.
15.20 Type II error and power
This section introduces Type II errors and the concept of statistical power, which is related to the ability of a test to detect a true effect 368.
- Type II error: Failing to reject the null hypothesis (H0) when it is false (i.e., when H1 is true).
- The probability of a Type II error depends on how far the true value lies from the hypothesized value μ0 368.
15.21 Power of a test
The power of a statistical test is the probability that the test correctly rejects the null hypothesis when a specific alternative value of the parameter is true. It is calculated as 1−β, where β is the probability of a Type II error.
This probability is influenced by several factors that affect the overlap between the distribution of the test statistic under the null hypothesis and the distribution under the alternative 369.
- Factors that increase power:
- Larger true difference: The further the true parameter value (μ) lies from the hypothesized value (μ0), the more the distribution under the alternative shifts, increasing the probability of rejection.
- Larger sample size (n): Increasing the sample size reduces the standard deviation of the sample mean (σ/n), making the distributions narrower and reducing overlap.
- Less variation in the population: A smaller population standard deviation (σ) also reduces the standard deviation of the sample mean, leading to narrower distributions and higher power.
- Larger significance level (α): A larger α means a wider rejection region, which increases the chance of detecting a true difference. However, this also increases the probability of a Type I error 370.
📝 For the Shark Tank data, testing the advisor's figure of 15 with a true mean of 13.21 and a sample size of 100, the power is approximately 0.56. This means that in 56% of samples, the test would correctly reject the advisor's claim. With a sample size of 400, the power increases to about 0.99 369 371.
15.22 Hypothesis testing for a proportion
Hypothesis tests for proportions follow the same five steps as tests for means, with specific calculations for the test statistic and its standard deviation under the null hypothesis. The test statistic is calculated as the difference between the sample proportion (p^) and the hypothesized proportion (p0), divided by the standard deviation of the sample proportion under the null hypothesis (SD0(p^)) 372.
- Test statistic calculation:
- The standard deviation under the null hypothesis is calculated as SD0(p^)=p0(1−p0)/n.
- This differs from the standard error used for confidence intervals, which uses the sample proportion p^ in the calculation: SE(p^)=p^(1−p^)/n.
- The test statistic is Z=(p^−p0)/SD0(p^).
- Assumptions for the normal approximation:
- The conditions np0≥10 and n(1−p0)≥10 must hold to use the normal distribution approximation for the test statistic 372 375.
📝 In a sample of 100 pitches, 64 ended with a deal (p^=0.64). Testing the claim that the proportion of deals is 0.50 (p0=0.50) at the 5% level:
- Hypotheses: H0:p=0.50 versus H1:p=0.50. α=0.05.
- Test statistic: SD0(p^)=0.50(1−0.50)/100=0.05. Z=(0.64−0.50)/0.05=2.80.
- Critical value: For a two-sided test at α=0.05, z0.975=1.96. Reject H0 if ∣Z∣≥1.96.
- Observed value: Zobs=2.80.
- Conclusion: Since 2.80≥1.96, reject H0. The deal proportion differs from 50%. The p-value is 2×P(Z≥2.80)≈0.0051 373 374.
15.23 One-sided tests
One-sided tests are used when the claim or hypothesis has a specific direction. They differ from two-sided tests primarily in the definition of the rejection region, where the entire significance level (α) is placed in one tail of the distribution 378.
- Types of one-sided tests for a mean (μ) against a value (μ0):
- Right-tailed: H0:μ≤μ0 versus H1:μ>μ0. Reject H0 if tobs≥t1−α,n−1.
- Left-tailed: H0:μ≥μ0 versus H1:μ<μ0. Reject H0 if tobs≤−t1−α,n−1 378.
- Null hypothesis logic: For one-sided tests, the null hypothesis often includes a range of values. The test is designed to control the Type I error probability at the value within H0 that is closest to the alternative hypothesis.
- P-value calculation: The p-value for a one-sided test is the area in the tail beyond the observed statistic in the direction of the alternative hypothesis 379.
📝 A founder claims that pitches offer less than 15% equity on average (H1:μ<15). With a sample mean of 12.76% and a t-statistic of -2.91 (with 99 degrees of freedom) at α=0.05:
- The critical value for a left-tailed test is t0.95,99≈−1.660.
- Since −2.91≤−1.660, we reject H0.
- The p-value is P(T≤−2.91)≈0.0023 379.
15.24 Interpreting test results
A statistically significant result indicates that the observed data are unlikely if the null hypothesis were true, but it does not imply a large or causal effect. The interpretation of a test result should always include the estimate, its standard error, the test statistic, the decision based on α or the p-value, and the confidence interval 380.
- What a significant result does not establish:
- Significance is not magnitude: A tiny difference can be statistically significant with a large sample size, while a practically important difference might be missed with a small sample.
- Significance is not causality: Hypothesis tests assess associations, not cause-and-effect relationships. Problems with data collection (e.g., selection bias) are not corrected by statistical testing.
- Reporting requirements: Always report the estimate with its units, the standard error, the observed test statistic, the decision at a stated α or the p-value, and the confidence interval.
- Comparing errors: The relative costs of Type I and Type II errors should be considered before making a decision. A Type I error is rejecting a true null hypothesis, while a Type II error is failing to reject a false null hypothesis 380.
📝 A language-learning app claims 10% of new users sign up. A new page resulted in 13% sign-ups from 400 users. Testing at α=0.05:
- H0:p=0.10 vs H1:p=0.10.
- SD0(p^)=0.10×0.90/400=0.015.
- Zobs=(0.13−0.10)/0.015=2.0.
- Since 2.0≥1.96, reject H0. The new page's sign-up rate differs from 10%.
- The cost of a Type I error (switching to a non-better page) is low. The cost of a Type II error (missing a better page) is high. Therefore, the decision is to switch 381.
15.25 Regression and hypothesis testing
Regression analysis extends hypothesis testing to examine relationships between variables. Each coefficient (slope) in a regression model is tested against zero, which represents no relationship between the predictor and the outcome variable.
The process mirrors the five steps of hypothesis testing used for means and proportions 382.
- Regression output interpretation:
- Software output typically provides the estimated coefficient, its standard error, a t-value (estimate divided by standard error), and a p-value for the test of the coefficient against zero 382.
- The t-value is calculated as t=(β^−0)/SE(β^), where β^ is the estimated slope and SE(β^) is its standard error.
- The p-value indicates the probability of observing such a slope (or more extreme) if there were truly no relationship (β1=0).
- Degrees of freedom: For regression with one predictor and a large sample, the t-distribution is very close to the standard normal distribution. The degrees of freedom are typically n−2 for a simple linear regression 383.
📝 In the Shark Tank data, a regression of equity offered (equity_offered_pct) against season shows a slope estimate (β^1) of -0.824 with a standard error of 0.048.
- The t-value is −0.824/0.048≈−17.3.
- The p-value is very small (e.g., 2.51×10−61), leading to rejection of H0:β1=0.
- This suggests a statistically significant association between season and equity offered, with equity decreasing over time 383.
15.26 Practice problems
This section provides practice problems to reinforce the concepts of hypothesis testing, including calculations for means and proportions, interpretation of results, and understanding the implications of Type I and Type II errors 385 386.
- Problem 1 (Mean test): Test if the average monthly booking hours for co-working space members differs from 50 hours, given a sample of 49 members with a mean of 53 hours and a standard deviation of 14 hours.
- Problem 2 (Error types for proportion test): Describe the Type I and Type II errors in the context of testing if the success proportion differs from 0.50, given 120 successes in 200 trials.
- Problem 3 (Mean test with normal assumption): Test if the average weight of bakery loaves differs from 800 grams, given a sample of 25 loaves with a mean of 792 grams and a standard deviation of 15 grams, assuming normal distribution of weights.
- Problem 4 (Interpreting significance and practical importance): Explain how a very large sample size can lead to a statistically significant result (p-value<0.001) for a mean difference that is too small to be practically important for business decisions 386.
15.27 Performing hypothesis tests
Hypothesis testing involves a structured, five-step procedure to determine if sample data provide sufficient evidence to reject a null hypothesis about a population parameter. This process helps in making decisions based on statistical evidence, acknowledging the possibility of errors 387 389 390 391.
The five steps are:
- Hypotheses: Clearly state the null hypothesis (H0) and the alternative hypothesis (H1). The null hypothesis represents the status quo or a specific claim, while the alternative hypothesis represents what we are trying to find evidence for.
- Test statistic: Calculate a test statistic based on the sample data. The distribution of this statistic under the null hypothesis is known (e.g., t-distribution or Z-distribution).
- Critical value and rejection region: Determine the critical value(s) from the appropriate distribution based on the significance level (α) and the alternative hypothesis. The rejection region consists of values of the test statistic that would lead to rejecting H0.
- Observed value: Compute the actual value of the test statistic from the sample data.
- Conclusion: Compare the observed value to the rejection region. If the observed value falls within the rejection region, reject H0. Otherwise, do not reject H0. The conclusion should be stated in the context of the problem 387 389 390 391.
The p-value, which is the probability of observing a test statistic as extreme as, or more extreme than, the one observed, if the null hypothesis were true, can also be used for decision-making. If the p-value is less than or equal to the significance level (α), H0 is rejected 387 389 391.
A confidence interval can also be used to perform a hypothesis test. If the hypothesized value of the parameter falls outside the confidence interval, H0 is rejected 387 389 391.
📝 A test for the mean number of hours booked per month among members.
- Hypotheses: H0:μ=50 versus H1:μ=50. Significance level α=0.05.
- Test statistic: T=(Xˉ−50)/(S/49), which follows a t48 distribution if H0 is true.
- Critical value and rejection region: Reject H0 if T≤−2.011 or T≥2.011.
- Observed value: Sample mean Xˉ=53 hours, sample standard deviation S=14 hours. Observed test statistic tobs=(53−50)/(14/49)=1.50.
- Conclusion: Since 1.50 is between −2.011 and 2.011, it is not in the rejection region. Do not reject H0. We cannot conclude that the mean number of hours booked differs from 50 387.
15.28 Errors in hypothesis testing390
Hypothesis testing inherently involves the risk of making incorrect decisions. Two types of errors can occur: Type I error and Type II error 387 389.
| Error Type | Definition | Consequence |
|---|---|---|
| Type I error | Rejecting the null hypothesis when it is actually true. | A false positive; concluding there is an effect or difference when there isn't one. |
| Type II error | Failing to reject the null hypothesis when it is actually false. | A false negative; failing to detect an effect or difference that truly exists. |
The significance level (α) is the probability of making a Type I error. The probability of a Type II error is denoted by β.
The power of a test is 1−β, representing the probability of correctly rejecting a false null hypothesis 390.
Factors influencing power include:
- Sample size: A larger sample size generally increases power.
- Significance level (α): Increasing α (e.g., from 0.05 to 0.10) increases power but also increases the risk of a Type I error.
- True difference from the null hypothesis: A larger true difference between the population parameter and the hypothesized value increases power 390.
Researchers can control the sample size and the significance level. The true difference is a characteristic of the population and cannot be changed by the researcher 390.
📝 A crowdfunding platform claims 40% of campaigns reach their goal (H0:p=0.40). A sample of 600 campaigns shows 270 reached the goal.
- Type I error: Concluding that the proportion of campaigns reaching the goal differs from 40% when it actually equals 40%.
- Factors affecting power: With α fixed, power increases with a larger sample size and a larger true difference from 0.40. The researcher can change the sample size 390.
15.29 Interpreting test results and confidence intervals389
The interpretation of hypothesis test results should be cautious and context-specific. Rejecting the null hypothesis suggests evidence for the alternative hypothesis, while failing to reject it means there is insufficient evidence to support the alternative.
It does not prove the null hypothesis is true 387 391.
A precise estimate (small standard error) does not automatically imply statistical significance or practical importance 387.
The relationship between hypothesis tests and confidence intervals is complementary. A two-sided test at significance level α will reject H0 if the hypothesized parameter value falls outside the (1−α)×100% confidence interval 387 389 391.
| Scenario | Hypothesis Test Decision | Confidence Interval Interpretation |
|---|---|---|
| Hypothesized value is outside the interval | Reject H0 | The interval does not contain the hypothesized value, supporting H1. |
| Hypothesized value is inside the interval | Do not reject H0 | The interval contains the hypothesized value, consistent with H0. |
When interpreting results, it's crucial to consider the sample size and the context of the research question. A statistically significant result (e.g., a small p-value) does not necessarily mean the effect is practically important, especially with very large sample sizes where even tiny differences can become statistically significant 387 389.
📝 An AI assistant misinterpreted a p-value.
- AI's statement: "There is only a 0.45% probability that the null hypothesis is true, so the difference must be large.".
- Corrected interpretation: The p-value of 0.0045 means that if the mean equity offered were 15%, a sample mean as far from 15% as observed would occur in about 0.45% of random samples. The p-value does not indicate the probability of the null hypothesis being true, nor does it directly speak to the size of the difference. The sample mean was 12.76%, and the 95% confidence interval was (11.23%, 14.29%), indicating a difference of 2.24 percentage points below 15% 391.
15.30 Applying hypothesis testing to real-world scenarios390 391
Hypothesis testing is a versatile tool applicable to various fields, including business and economics, for making data-driven decisions 388 392.
| Context | Claim to Defend | Potential Errors and Costs | Strategy to Raise Power |
|---|---|---|---|
| Student-run meal-prep box venture | Conversion rate differs from sector's 3% (H0:p=0.03 vs H1:p=0.03) | A false alarm (Type I error) is costlier, as it could lead to signing a larger kitchen lease based on a non-existent difference. | Increase sample size by extending data collection period (e.g., running a tasting stand for two more weeks). |
| Webshop promising average arrival time of 3 days | Mean arrival time differs from 3 days (H0:μ=3 vs H1:μ=3) | A false alarm (Type I error) could lead to unnecessary investment in logistics if the average is not truly different from 3 days. | Increase sample size or consider a larger true difference from 3 days (though the latter is not controllable). |
When choosing an alternative hypothesis (one-sided vs. two-sided), it must be determined before inspecting the data to avoid biasing the results and inflating the Type I error rate 388.
The 10% condition, often relevant for sampling without replacement from a finite population, states that the sample size should be no more than 10% of the population size to ensure the independence of observations 391.
16. Tutorial 4: Hypothesis tests, errors, and power
16.1 Tutorial 4: Hypothesis tests, errors, and power
This tutorial focuses on hypothesis testing, including the steps involved, interpreting results, and understanding potential errors. It covers tests for means and proportions, confidence intervals, and the relationship between them 393.
16.2 Preparation for the tutorial
Before attending the tutorial, students are expected to recall and write from memory:
- The five steps of a hypothesis test in order.
- The test statistic for a mean when σ is unknown and its distribution if H0 is true.
- The test statistic for a proportion and its distribution if H0 is true.
- The rejection rule for a two-sided test at a given significance level α.
- The definition of a two-sided p-value and how it relates to the critical value decision.
- The definitions of Type I and Type II errors 393.
16.3 Key concepts in hypothesis testing 394
Hypothesis testing involves a structured approach to determine if sample data provides sufficient evidence to reject a null hypothesis (H0) 394.
| Step | Description |
|---|---|
| 1. Hypotheses | State the null hypothesis (H0) and the alternative hypothesis (H1), along with the significance level (α). |
| 2. Test statistic | Calculate the test statistic and identify its distribution if H0 is true, noting any necessary conditions (e.g., population normality or large sample size). |
| 3. Critical value and rejection region | Determine the critical value(s) based on α and the distribution, defining the rejection region. |
| 4. Observed value | Calculate the value of the test statistic from the sample data. |
| 5. Conclusion | Compare the observed value to the rejection region. State the decision (reject H0 or do not reject H0) and interpret it in the context of the problem, including units and population. |
📝 The five steps of hypothesis testing are: 1. State the null hypothesis (H0) and the alternative hypothesis (H1), along with the significance level (α). 2. Calculate the test statistic and identify its distribution if H0 is true. 3. Determine the critical value(s) and rejection region. 4. Calculate the observed value of the test statistic from the sample data. 5. Compare the observed value to the rejection region and state the conclusion 394.
16.4 Test for a mean
When the population standard deviation (σ) is unknown, a t-test is used for the mean. The test statistic is T=(Xˉ−μ0)/(s/n), which follows a tn−1 distribution if H0 is true, provided the population is normal or n is large 394.
16.5 Test for a proportion
For a proportion, the test statistic is Z=(P^−p0)/p0(1−p0)/n. If H0 is true, Z is approximately normally distributed N(0,1), provided np0≥10 and n(1−p0)≥10 394.
📝 For a proportion test, the test statistic is Z=(P^−p0)/p0(1−p0)/n, which is approximately normally distributed N(0,1) if H0 is true and np0≥10 and n(1−p0)≥10 394.
16.6 Rejection rule and p-value
For a two-sided test, H0 is rejected if the absolute value of the observed test statistic is greater than or equal to the critical value (∣tobs∣≥t1−α/2,n−1 for a t-test, or ∣zobs∣≥z1−α/2 for a z-test). The p-value is the probability of observing a test statistic at least as extreme as the one calculated, assuming H0 is true.
A p-value less than or equal to α leads to the same decision as the critical value rule 394.
16.7 Errors in hypothesis testing
- Type I error: Rejecting H0 when H0 is actually true. The probability of a Type I error is at most α.
- Type II error: Not rejecting H0 when H1 is actually true 394.
16.8 Task 1: A test for a mean and its confidence interval
This task involves testing a claim about the mean equity offered in Shark Tank pitches and constructing a confidence interval 395.
16.9 Testing the mean equity offered
The sample of 100 pitches had a mean equity of 12.76% and a standard deviation of 7.71%. The advisor claimed the average equity offered is 14.5% 395.
- Hypotheses: H0:μ=14.5 against H1:μ=14.5, with α=0.05.
- Test statistic: T=(Xˉ−14.5)/(s/n). With n=100, df=99, T follows a t99 distribution if H0 is true.
- Critical value and rejection region: For α=0.05, t0.975,99=1.984. Reject H0 if tobs≤−1.984 or tobs≥1.984.
- Observed value: Standard error s/n=7.71/100=0.771. Observed value tobs=(12.76−14.5)/0.771=−2.26.
- Conclusion: Since −2.26≤−1.984, reject H0. The mean equity offered differs from 14.5%, and is likely lower 396.
16.10 Test at the 1% level
Repeating the test at α=0.01:
- Critical value t0.995,99=2.626. Reject H0 if tobs≤−2.626 or tobs≥2.626.
- The observed value tobs=−2.26 does not fall in the rejection region. Do not reject H0. The decision changes because the stricter 1% level requires stronger evidence 396.
16.11 99% confidence interval for the mean
- Formula: Xˉ±t1−α/2,n−1(s/n).
- Given values: Xˉ=12.76%, s=7.71%, n=100, df=99, confidence level 99%, critical value t0.995,99=2.626.
- Calculations: Standard error = 0.771. Margin of error = 2.626×0.771=2.02.
- Interval: (12.76−2.02,12.76+2.02)=(10.74,14.78)%.
- Conclusion: The value 14.5% lies within this interval. At the 1% level, we cannot conclude that the mean equity differs from 14.5% 396.
16.12 Relationship between interval and test decision
The 99% confidence interval corresponds to the test at the 1% significance level. Since 14.5 lies within the 99% interval, the test at the 1% level does not reject H0.
The 95% interval (using t0.975,99=1.984) would not contain 14.5, aligning with the decision to reject H0 at the 5% level. [396-397]
16.13 P-value interpretation
The reported two-sided p-value of 0.026 leads to the same decisions:
- At the 5% level (α=0.05), 0.026≤0.05, so reject H0.
- At the 1% level (α=0.01), 0.026>0.01, so do not reject H0 397.
16.14 Task 2: A test for a proportion and its confidence interval
This task examines the proportion of Shark Tank pitches that result in a deal 398.
16.15 Testing the proportion of deals
A commentator claims that three quarters (75%) of pitches result in a deal. In a sample of 100 pitches, 64 resulted in a deal (P^=0.64) 398.
- Hypotheses: H0:p=0.75 against H1:p=0.75, with α=0.05.
- Test statistic: Z=(P^−p0)/p0(1−p0)/n. If H0 is true, Z≈N(0,1). Conditions: np0=100×0.75=75≥10 and n(1−p0)=100×0.25=25≥10.
- Critical value and rejection region: For α=0.05, z0.975=1.960. Reject H0 if zobs≤−1.960 or zobs≥1.960.
- Observed value: Standard deviation under H0 is 0.75×0.25/100=0.0433. Observed value zobs=(0.64−0.75)/0.0433=−2.54.
- Conclusion: Since −2.54≤−1.960, reject H0. The proportion of deals differs from 75%, and is likely lower 399.
16.16 90% confidence interval for the proportion
- Formula: P^±z1−α/2P^(1−P^)/n.
- Given values: P^=0.64, n=100. Confidence level 90%, so z0.95=1.645. Conditions: nP^=100×0.64=64≥10 and n(1−P^)=100×0.36=36≥10.
- Calculations: Standard error = 0.64×0.36/100=0.048. Margin of error = 1.645×0.048=0.079.
- Interval: (0.64−0.079,0.64+0.079)=(0.561,0.719), or 56.1% to 71.9%.
- Conclusion: The value 0.75 lies outside this interval. At the 10% level, we can conclude the proportion differs from 75%, and the entire interval is below 75% 399.
16.17 Difference between test denominator and interval standard error
The test uses p0(1−p0)/n=0.0433 as the denominator, assuming p0=0.75 is true. The interval uses P^(1−P^)/n=0.048, which is the estimated standard error based on the sample proportion.
These differ because the test assumes a specific population proportion, while the interval estimates it from the data 399.
16.18 Interval and test agreement for proportions
The 90% interval does not contain 0.75, and the test at the 10% level rejects H0. This agreement is not always guaranteed for proportions because the denominators used in the test statistic and the standard error of the interval differ.
The reported p-value of 0.011 is below 0.05, confirming the rejection of H0 399.
16.19 Task 3: Read a test from software output
This task involves interpreting the output of a one-sample t-test for the mean number of coffee cups sold per day 400.
16.20 Test hypotheses and interpretation
A franchise claims an average of 400 cups sold per day. A sample of 64 cafés showed a mean of 376 cups with a standard deviation of 48 cups 400.
- Hypotheses: H0:μ=400 against H1:μ=400, where μ is the mean daily sales of all 900 franchise cafés.
- Interpretation of output:
- mean of x: The sample mean is 376 cups per day.
- t: The observed test statistic is -4.00. Calculated as (376−400)/(48/64)=−4.00. [401-402]
- df: Degrees of freedom are 63 (n−1) 401.
- p-value: 0.0001691. This is the probability of observing a sample mean as far from 400 as 376, or further, if the true mean were 400.
- Confidence interval: The 95% interval is (364.01, 387.99) cups per day. This range represents plausible values for the true mean. [401-402]
- Statistical conclusion at 5% level:
- Critical value t0.975,63=1.998.
- Observed value tobs=−4.00. Since −4.00≤−1.998, reject H0.
- The p-value (0.0001691) is less than 0.05, confirming rejection.
- The 95% interval (364.01, 387.99) does not contain 400, also confirming rejection.
- Conclusion: The mean daily sales differ from 400 cups, and are likely lower.
- Claims the output cannot justify:
- The output does not explain why sales are lower (causality).
- It does not guarantee that a new café will sell 376 cups; individual café sales vary more than the mean 402.
16.21 Task 4: Errors, power, and what changes a decision
This task explores the concepts of errors, power, and how sample size and significance level affect hypothesis test decisions 403.
16.22 Factors affecting standard error and power
- Larger sample size: Decreases the standard error (as n in the denominator increases) and thus increases the power of the test.
- Raising α: Increases power but also increases the probability of a Type I error, as the rejection region becomes wider 404.
16.23 Possible errors after a decision
- If H0 is rejected (as in Task 3), only a Type I error is possible.
- If H0 is not rejected, only a Type II error is possible 404.
16.24 Invented example: Haircut times
A barbershop founder plans 40 minutes per haircut. A sample of 36 haircuts has a mean of 44 minutes and a standard deviation of 12 minutes.
Haircut times are roughly normal 403.
- Observed value: Standard error s/n=12/36=2 minutes. tobs=(44−40)/2=2.00.
- Decisions:
- 10% level: Critical value t0.95,35=1.690. Reject H0 if tobs≤−1.690 or tobs≥1.690. Since 2.00≥1.690, reject H0. Mean haircut time differs from 40 minutes and is likely higher.
- 1% level: Critical value t0.995,35=2.724. Reject H0 if tobs≤−2.724 or tobs≥2.724. Since 2.00 is between −2.724 and 2.724, do not reject H0. Cannot conclude mean differs from 40 minutes.
- Larger sample (n=144):
- Standard error s/n=12/144=1 minute. tobs=(44−40)/1=4.00.
- 1% level: Critical value t0.995,143=2.611. Reject H0 if tobs≤−2.611 or tobs≥2.611. Since 4.00≥2.611, reject H0. Mean haircut time differs from 40 minutes and is likely higher.
- Changes in decision:
- The smaller α (1% vs 10%) moved the critical value further from zero (2.724 vs 1.690), leading to non-rejection with the smaller sample. This protects against Type I error but increases Type II error risk.
- The larger sample size (144 vs 36) reduced the standard error (1 min vs 2 min), making the observed difference of 4 minutes more significant (tobs=4.00 vs tobs=2.00). This increases power 404.
- After the two rejections (36 haircuts at 10%, 144 haircuts at 1%), only a Type I error is possible. After not rejecting with 36 haircuts at 1%, only a Type II error is possible. [404-405]
16.25 Repairing a conclusion
The conclusion "The result is significant, so the new coffee bars that opened near many franchise cafés cause the lower sales, and there is less than a 0.1% chance that the brochure figure of 400 cups is true" contains two errors 405:
- A significant result does not prove causation; it only indicates a difference from the null hypothesis.
- The p-value is not the probability that the null hypothesis is true 406.
A better conclusion: "Last month the franchise cafés sold about 376 cups per day on average, 24 cups or 6% below the brochure figure (95% interval from 364 to 388 cups). If the mean of all 900 cafés were 400 cups, a sample mean this far from 400 would occur in fewer than 0.1% of random samples.
The test does not say why the sales are lower." 406.
16.26 Individual practice
This section provides practice problems on hypothesis testing and confidence intervals for means and proportions 406.
16.27 Test for mean spending
A sample of 81 customers has a mean spending of 42 euros and a standard deviation of 9 euros 406.
- Test: H0:μ=40 against H1:μ=40, α=0.05.
- Standard error s/n=9/81=1 euro.
- Observed value tobs=(42−40)/1=2.00.
- Critical value t0.975,80=1.990. Reject H0 if tobs≤−1.990 or tobs≥1.990.
- Conclusion: Since 2.00≥1.990, reject H0. Mean spending differs from 40 euros and is likely higher 407.
- 95% confidence interval for mean:
- Formula: Xˉ±t1−α/2,n−1(s/n) 407.
- Given: Xˉ=42, s=9, n=81, df=80, $t_{
16.28 Notation used throughout
This section lists symbols and their meanings used across the QM Basic course material. These symbols are essential for understanding formulas and concepts in statistics 417.
- Sample space: Denoted by Ω, it represents the set of all possible outcomes.
- Events: Represented by capital letters like A and B, these are subsets of the sample space.
- Complement of an event: Ac denotes the event that A does not occur.
- Random variables: Symbols like X and Y represent variables whose values are outcomes of a random phenomenon.
- Observed values: xi and yi are specific values of random variables observed in a sample.
- Sample size: n represents the number of observations in a sample.
- Population mean, variance, standard deviation, proportion: μ, σ2, σ, and p denote these parameters for the entire population.
- Estimators: Xˉ, S2, and p^ are statistics calculated from a sample to estimate population parameters.
- Estimates: xˉ, s2, and p^ are the specific values of estimators in one particular sample.
- Standard deviation of an estimator: SD(Xˉ) is the standard deviation of the sampling distribution of the sample mean.
- Standard error: SE(Xˉ) is the estimate of the standard deviation of an estimator, calculated from the sample.
- Significance level: α is the probability of making a Type I error in hypothesis testing.
- Degrees of freedom: df is a parameter used in distributions like the t-distribution 417.
16.29 Lecture 7 - Samples, parameters, and estimators
This lecture covers the fundamental concepts of samples, population parameters, and the statistics used to estimate them 422.
📝 If a population has a mean μ and a sample of size n is drawn, the sample mean Xˉ is an estimator for μ, and its expected value is E[Xˉ]=μ 423.
16.30 Sample mean and sample proportion estimators
The sample mean (Xˉ) and sample proportion (p^) are used to estimate the population mean (μ) and population proportion (p), respectively 422.
📝 If you have a sample of 100 individuals (n=100) and you want to estimate the proportion of people who prefer brand A, you would use the sample proportion p^ as your estimator for the population proportion p 422.
16.31 Sample variance and degrees of freedom 422
The sample variance (S2) is an estimator for the population variance (σ2). The degrees of freedom (df) for the sample variance calculation is n−1 422.
| Statistic | Formula | Degrees of Freedom |
|---|---|---|
| Sample Variance (S2) | s2=n−11∑i=1n(Xi−Xˉ)2 | n−1 |
16.32 Unbiased estimators 423
Unbiased estimators are statistics whose expected value is equal to the population parameter they are estimating. This ensures that, on average, the estimator will not systematically over- or under-estimate the true parameter 423.
| Parameter | Unbiased Estimator | Expected Value |
|---|---|---|
| Population Mean (μ) | Sample Mean (Xˉ) | E[Xˉ]=μ |
| Population Proportion (p) | Sample Proportion (p^) | E[p^]=p |
| Population Variance (σ2) | Sample Variance (S2) | E[S2]=σ2 |
16.33 Random sample and the 10% condition
A random sample is a sample where each member of the population has an equal chance of being selected. The 10% condition states that if the sample size n is no more than 10% of the population size N (n≤0.10N), then the observations can be treated as independent, even if sampling is done without replacement 423.
16.34 Lecture 8 - Sampling distributions, the central limit theorem, and the t distribution
This lecture focuses on the distributions of sample statistics, particularly the sample mean and proportion, and introduces the Central Limit Theorem and the t-distribution 423.
16.35 Sample mean: standard deviation and standard error
The standard deviation of the sampling distribution of the sample mean (σ/n) quantifies the variability of sample means around the population mean. The standard error (S/n) is its estimate from the sample 423.
16.36 Distribution of the sample mean 424
The distribution of the sample mean (Xˉ) is approximately normal with mean μ and variance σ2/n for large sample sizes, according to the Central Limit Theorem. If the population is normally distributed, the distribution of Xˉ is exactly normal 424.
| Statistic | Distribution | Parameters |
|---|---|---|
| Sample Mean (Xˉ) | Approximately Normal | Mean: μ, Variance: nσ2 |
16.37 Sample proportion: standard deviation and standard error
The standard deviation of the sampling distribution of the sample proportion is p(1−p)/n. The standard error of the sample proportion is its estimate from the sample, p^(1−p^)/n 424.
16.38 Distribution of the sample proportion
The distribution of the sample proportion (p^) is approximately normal if the success-failure condition (np≥10 and n(1−p)≥10) is met 424.
16.39 Success-failure condition
This condition (np≥10 and n(1−p)≥10) is used to determine if the normal approximation to the binomial distribution is appropriate for the sample proportion 424.
16.40 One-sample t statistic 424
When the population standard deviation (σ) is unknown and estimated by the sample standard deviation (S), the one-sample t statistic is used. Its distribution is the t-distribution with n−1 degrees of freedom 424.
| Statistic | Formula | Distribution under H0 |
|---|---|---|
| One-sample t statistic | T=S/nXˉ−μ | tn−1 |
📝 If the population standard deviation is unknown and you have a sample mean Xˉ=50, a sample standard deviation S=10, and a sample size n=25, the one-sample t statistic is T=10/2550−μ 424.
16.41 Lecture 9 - Confidence intervals
Confidence intervals provide a range of plausible values for a population parameter based on sample data 425.
16.42 Confidence interval for a mean and for a proportion
A confidence interval for a mean is typically calculated as Xˉ±tα/2,n−1nS, while for a proportion it is p^±zα/2np^(1−p^), provided the success-failure condition holds 425.
16.43 Critical values
Critical values (zα/2 or tα/2,df) are used to determine the width of the confidence interval. These values correspond to the quantiles of the standard normal or t-distribution for a given confidence level (1−α) 425.
- Confidence Level (1-α): zα/2 (Normal), df=5, df=10, df=20, df=30, df=60, df=100, df=120
- 0.90: 1.645, 2.015, 1.812, 1.725, 1.697, 1.671, 1.660, 1.658
- 0.95: 1.960, 2.571, 2.228, 2.086, 2.042, 2.000, 1.984, 1.980
- 0.99: 2.576, 4.032, 3.169, 2.845, 2.750, 2.660, 2.626, 2.617 425.
16.44 Sample size for a margin of error
The required sample size (n) for a confidence interval can be calculated to achieve a desired margin of error (m) around a mean, using the formula n≥(mz1−α/2σ)2 425.
16.45 Confidence interval in five parts
A structured approach to constructing and interpreting confidence intervals involves: 1) stating the formula, 2) identifying given values, 3) performing calculations (standard error, margin of error), 4) constructing the interval, and 5) drawing a conclusion in context 425.
16.46 Lecture 10 - Testing decisions, errors, and power
This lecture introduces the process of hypothesis testing, including identifying potential errors and understanding the concept of statistical power 425.
16.47 Test in five steps
Hypothesis testing follows a systematic five-step procedure: 1) state hypotheses (H0, H1) and significance level (α), 2) determine the test statistic and its distribution under H0, 3) find the critical value and rejection region, 4) calculate the observed test statistic value, and 5) draw a conclusion 425.
16.48 Two-sided test for a mean
For a two-sided test of a mean, the null hypothesis (H0:μ=μ0) is tested against the alternative hypothesis (H1:μ=μ0). The test statistic T=S/nXˉ−μ0 follows a t-distribution with n−1 degrees of freedom under H0. H0 is rejected if the absolute value of the observed test statistic (∣tobs∣) is greater than or equal to the critical t-value (tα/2,n−1) 425.
16.49 Two-sided test for a proportion
A two-sided test for a proportion involves H0:p=p0 versus H1:p=p0. The test statistic Z=SD0(p^)p^−p0 is approximately standard normal under H0, where SD0(p^)=np0(1−p0). H0 is rejected if ∣zobs∣≥zα/2.
This test requires the success-failure condition (np0≥10 and n(1−p0)≥10) 425.
16.50 Two-sided p-value
The p-value for a two-sided test is twice the probability of observing a test statistic as extreme as, or more extreme than, the one observed, in either direction. For a t-test, p=2P(T≥∣tobs∣), and for a Z-test, p=2P(Z≥∣zobs∣).
If p≤α, H0 is rejected 426.
16.51 Test and confidence interval for a mean
A null hypothesis H0:μ=μ0 is rejected at level α if μ0 falls outside the (1−α) confidence interval for the mean 426.
16.52 Type I error, Type II error, and power
- Type I error: Rejecting H0 when it is actually true. The probability of a Type I error is controlled by α, so P(Type I error)≤α.
- Type II error: Failing to reject H0 when it is false.
- Power: The probability of correctly rejecting H0 when it is false. Power is calculated as 1−P(Type II error) 426.
17. QM Basic Mock Exam
17.1 Question 1: Data and a histogram (11 points)
This question assesses understanding of data description, variable types, and histogram interpretation.
-
Dataset Representation: One row of the dataset represents a single application to the entrepreneurship centre's accelerator program, detailing a specific venture's request. The 240 rows describe all applications received by the centre in the current year 427 429.
-
Variable Types:
-
application_id: Identifier. -
stage: Categorical and ordinal, as its categories (idea, prototype, first sales) have a defined order but no numerical distances. -
accepted: Categorical and nominal (binary), stored as 0 or 1 429. -
Cumulative Counts and Shares:
-
The cumulative counts for the six funding intervals are 58, 146, 200, 224, 234, and 240.
-
The corresponding cumulative shares are 0.2417, 0.6083, 0.8333, 0.9333, 0.9750, and 1.0000 429.
-
Median and Upper Quartile Intervals:
-
The median is located between the 120th and 121st ordered values. The cumulative share first exceeds 0.50 in the second interval (0.6083), indicating the median falls between 20 and 40 thousand euros.
-
The upper quartile (180th value) falls within the third interval, as the cumulative share first reaches 0.75 (0.8333) in this interval, meaning it is between 40 and 60 thousand euros 429.
-
Normal Model Fit: A normal model does not fit because the histogram is skewed to the right. The counts decrease slowly on the right side, unlike a symmetric normal curve 429.
-
Claim Support:
-
The data cannot support the claim that "Most new ventures in the Netherlands need at most 40 thousand euros" because the 240 ventures are self-selected applicants, not a random sample of all Dutch new ventures.
-
A revised sentence that the data can support is: "Of the 240 applications to this accelerator, 146 (60.83%) requested at most 40 thousand euros." 429.
17.2 Question 2: Probability from a table, and a decision about checks (14 points)
This question involves calculating probabilities from a contingency table and applying decision-making based on expected values.
-
Probability Calculations:
-
P(D)=210/500=0.42.
-
P(D∩W)=90/500=0.18.
-
P(D∪W)=P(D)+P(W)−P(D∩W)=0.42+0.40−0.18=0.64.
-
P(D∣W)=P(D∩W)/P(W)=90/200=0.45.
-
P(W∣D)=P(D∩W)/P(D)=90/210≈0.4286 431.
-
Independence Test:
-
P(D)×P(W)=0.42×0.40=0.168.
-
Since P(D∩W)=0.18 is not equal to P(D)×P(W)=0.168, the events D and W are not independent 431.
-
E-scooter Rental Scenario:
-
Tree Counts (for 1,000 rentals):
-
Damage, Flagged: 1000×0.05×0.80=40.
-
Damage, Not Flagged: 1000×0.05×0.20=10.
-
No Damage, Flagged: 1000×0.95×0.10=95.
-
No Damage, Not Flagged: 1000×0.95×0.90=855.
-
Probability of Damage Given Flagged: P(damage∣flag)=40/(40+95)≈0.2963.
-
Probability of Damage Given No Flag: P(damage∣no flag)=10/(10+855)≈0.0116 431.
-
Decision on Checks:
-
Flagged Rentals: Expected gain = 0.2963×60 euros≈17.78 euros. This is above the 4 euro cost.
-
Rentals Without a Flag: Expected gain = 0.0116×60 euros≈0.69 euros. This is below the 4 euro cost.
-
Decision: The founder should check only the flagged rentals 431.
📝 The founder should check only the flagged rentals because the expected gain of 17.78 euros is above the 4 euro cost, while for rentals without a flag, the expected gain is only 0.69 euros 431.
17.3 Question 3: Expected value, spread, and two variables (17 points)
This question covers expected value, variance, standard deviation, profit calculations, and bivariate probability distributions.
-
Repair Number (R):
-
Expected Value: E[R]=2(0.3)+4(0.5)+7(0.2)=0.6+2.0+1.4=4 repairs.
-
Variance: E[R2]=22(0.3)+42(0.5)+72(0.2)=4(0.3)+16(0.5)+49(0.2)=1.2+8+9.8=19. Var(R)=E[R2]−(E[R])2=19−42=19−16=3.
-
Standard Deviation: SD(R)=Var(R)=3≈1.7321 repairs 434.
-
Morning Profit (W):
-
Expected Profit: E[W]=E[25R−40]=25E[R]−40=25(4)−40=100−40=60 euros.
-
Standard Deviation of Profit: SD(W)=Var(25R−40)=252Var(R)=25Var(R)=253≈43.3013 euros 434.
-
Case (X) and Screen Protector (Y) Purchases:
-
Probabilities:
-
P(X=1)=P(X=1,Y=0)+P(X=1,Y=1)=0.20+0.20=0.40.
-
P(Y=1)=P(X=0,Y=1)+P(X=1,Y=1)=0.20+0.20=0.40.
-
Conditional Mean: E[Y∣X=1]=P(Y=0∣X=1)×0+P(Y=1∣X=1)×1. P(Y=1∣X=1)=P(X=1,Y=1)/P(X=1)=0.20/0.40=0.50. So, E[Y∣X=1]=0.50.
-
Interpretation: Half of the customers who buy a case also buy a screen protector.
-
Covariance: E[X]=0.40. E[Y]=0.30. E[XY]=P(X=1,Y=1)=0.20. Cov(X,Y)=E[XY]−E[X]E[Y]=0.20−(0.40)(0.30)=0.20−0.12=0.08.
-
Number of Products (X+Y):
-
E[X+Y]=E[X]+E[Y]=0.40+0.30=0.70 products.
-
Var(X)=P(X=1)(1−P(X=1))=0.40(1−0.40)=0.40(0.60)=0.24.
-
Var(Y)=P(Y=1)(1−P(Y=1))=0.30(1−0.30)=0.30(0.70)=0.21.
-
Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y)=0.24+0.21+2(0.08)=0.45+0.16=0.61.
-
Correlation:
-
ρXY=Cov(X,Y)/Var(X)Var(Y)=0.08/0.24×0.21=0.08/0.0504≈0.08/0.2245≈0.3563.
-
Interpretation: The correlation is positive and moderate, suggesting that customers who buy a case tend to also buy a screen protector 434.
-
Third Variable Explanation: A third variable, such as a customer having a new phone, could explain the correlation. A customer with a new phone is more likely to want to protect it and thus buy both a case and a screen protector. This would mean offering a free case does not necessarily increase protector sales if the underlying driver is the newness of the phone 434.
17.4 Question 4: A normal model and the precision of a sample mean (13 points)
This question involves calculations with uniform and normal distributions, and understanding the properties of sample means.
-
Uniform Distribution (X): X∼U(15,40)
-
P(22<X<32): The probability is the length of the interval divided by the length of the support: (32−22)/(40−15)=10/25=0.40 437.
-
Normal Distribution (Y): Y∼N(120,82)
-
P(Y≤132): z=(132−120)/8=1.5. P(Y≤132)=P(Z≤1.5)=0.9332.
-
P(Y≤112): z=(112−120)/8=−1.0. P(Y≤112)=P(Z≤−1.0)=1−P(Z≤1.0)=1−0.8413=0.1587.
-
Maximum Repair Time: To ensure 90% of repairs take at most this time, we need the 90th percentile. 120+z0.90×8=120+1.2816×8=120+10.2528=130.2528 minutes 437.
-
Sample Mean (V̄): Price V∼N(μ=85,σ=20). Sample size n=100.
-
Standard Deviation of Sample Mean: SD(Vˉ)=σ/n=20/100=20/10=2 euros.
-
Probability Sample Mean Above 89 Euros: By the Central Limit Theorem (CLT), Vˉ is approximately normal with mean 85 and standard deviation 2. z=(89−85)/2=4/2=2.0. P(Vˉ>89)=P(Z>2.0)=1−P(Z≤2.0)=1−0.9772=0.0228 437.
-
Sample Size for Standard Deviation: To halve the standard deviation of the sample mean (from 2 to 1), the sample size needs to be quadrupled. n=4×100=400 437.
-
Sample Size for Margin of Error: Margin of error ≤5 euros at 95% confidence. Using σ=20 as a planning value. n≥(z0.975×σ/ME)2=(1.96×20/5)2=(1.96×4)2=7.842=61.4656. Round up to 62 repairs 437.
📝 For a sample of 100 repairs with a mean price of 85 euros and a standard deviation of 20 euros, the probability that the sample mean is above 89 euros is 0.0228 437.
17.5 Question 5: A mean test in five steps, and R output (14 points)
This question focuses on hypothesis testing for a mean and interpreting confidence intervals and R output.
-
Parameter and Estimate:
-
(a) μ represents the mean order value of all 2,400 orders from last year.
-
(b) The estimate of μ is xˉ=64.60 euros 439.
-
Hypothesis Test (5 Steps):
-
Step 1: Hypotheses:
-
H0:μ=60 (The mean order value is 60 euros).
-
H1:μ=60 (The mean order value differs from 60 euros).
-
Significance level α=0.05.
-
Step 2: Test Statistic: T=(Xˉ−60)/(S/n). Since n=121 is large and the sample is random, T approximately follows a t-distribution with df=120. The draws can be treated as independent as 121≤0.10×2400.
-
Step 3: Critical Value and Rejection Region: For a two-sided test at α=0.05 with df=120, t0.975,120=1.980. Reject H0 if tobs≤−1.980 or tobs≥1.980.
-
Step 4: Observed Value: Standard error SE=S/n=22/121=22/11=2.00 euros. Observed test statistic tobs=(64.60−60)/2.00=4.60/2.00=2.30.
-
Step 5: Conclusion: Since 2.30≥1.980, the observed value falls in the rejection region. Reject H0. At the 5% level, we conclude that the mean order value differs from 60 euros, and it is higher 440.
-
Interpretation of p-value: If the true mean order value were 60 euros, a sample mean as extreme as or more extreme than the observed 66.4 euros (in either direction) would occur with a probability of 0.008949 (0.8949%) 439.
-
Confidence Interval Calculation:
-
Standard error SE=24.00/100=2.40 euros.
-
Critical value t0.975,99=1.984.
-
Interval: 66.40±1.984×2.40=66.40±4.7616. The interval is (61.6384, 71.1616) euros 440.
-
Advice to Founder:
-
(a) Rent the larger storage room. Both ends of the 95% confidence interval (61.64 to 71.16 euros) are above 60 euros, indicating the mean order value is likely significantly higher than 60 euros 439.
-
(b) The data represent orders from this year so far and do not guarantee that future orders will maintain this mean 440.
17.6 Question 6: An interval and a test for a proportion, two errors, and power (22 points)
This question covers confidence intervals and hypothesis testing for proportions, including error types and power.
-
Sampling Method:
-
(a) This sampling method is a voluntary-response sample.
-
(b) The founder's random draw is better because it ensures every trial customer has an equal chance of selection, making the results representative of all 1,500 customers. A weakness of the survey is that customers who choose to respond may differ systematically (e.g., be more engaged). A strength of the random draw is its representativeness 444.
-
95% Confidence Interval for Proportion (p):
-
Formula: p^±z0.975p^(1−p^)/n. Conditions np^≥10 and n(1−p^)≥10 are met (26≥10, 74≥10).
-
Given Values: p^=26/100=0.26. z0.975=1.96.
-
Calculations: Standard error SE=0.26×0.74/100≈0.0439. Margin of error ME=1.96×0.0439≈0.0860.
-
Interval: (0.26−0.0860,0.26+0.0860)=(0.1740,0.3460).
-
Conclusion: Since 0.20 lies within the interval (0.1740, 0.3460), we cannot conclude at the 5% level that her share differs from 20% 444.
-
Hypothesis Test (5 Steps):
-
Step 1: Hypotheses: H0:p=0.20 vs. H1:p=0.20, with α=0.05.
-
Step 2: Test Statistic: Z=(p^−p0)/p0(1−p0)/n. Under H0, Z is approximately N(0,1) because np0=100(0.20)=20≥10 and n(1−p0)=100(0.80)=80≥10.
-
Step 3: Critical Value and Rejection Region: z0.975=1.96. Reject H0 if zobs≤−1.96 or zobs≥1.96.
-
Step 4: Observed Value: Standard deviation under H0 is SD0(p^)=0.20×0.80/100=0.0016=0.04. Observed test statistic zobs=(0.26−0.20)/0.04=0.06/0.04=1.50.
-
Step 5: Conclusion: Since −1.96<1.50<1.96, the observed value does not fall in the rejection region. Do not reject H0. At the 5% level, we cannot conclude her share differs from 20% 444.
-
Error Types:
-
(a) Type I Error: The test concludes her share differs from 20% when, in reality, it is
17.7 Mock Exam Questions and Answers
This section provides a mock exam for QM Basic, focusing on quantitative methods for understanding Economics & Business Innovation. It includes practice questions and their corresponding model answers, covering calculations, interpretations, units, conditions, and decisions.
The exam is worth 100 points in total 448.
The provided R code is for checking the numbers in the model answers and is optional for practice 448.
| Parameter | Value |
|---|---|
| t_df63 | 1.9983405 |
| standard_error | 1.5000000 |
| margin | 2.9970000 |
| lower | 24.5030000 |
| upper | 30.4970000 |
| t_obs | -1.6666667 |
| p_value | 0.1005453 |
| below_plan_in_percent | 16.6666667 |
| n_ai_full_width | 22.127616 |
| n_correct | 88.510464 |
| n_correct_rounded_up | 89.000000 |
| width_with_23 | 9.808518 |
The R code demonstrates calculations for various statistical measures:
- Standard error: Calculated as the standard deviation divided by the square root of the sample size.
- Margin of error: The product of the critical value (t-score) and the standard error.
- Confidence interval: Calculated as the sample mean plus or minus the margin of error.
- Observed t-statistic: The difference between the sample mean and the hypothesized population mean, divided by the standard error.
- P-value: The probability of observing a test statistic as extreme as, or more extreme than, the one observed, assuming the null hypothesis is true.
- Percentage below plan: Calculated as 100% times the difference between the target value and the observed value, divided by the target value.
- Sample size for AI full width: Determined using the formula (z×σ/E)2, where z is the z-score for the desired confidence level, σ is the population standard deviation, and E is the desired margin of error.
- Sample size for correct responses: Calculated similarly to the AI full width, adjusted for the desired precision.
- Rounded-up sample size: The ceiling of the calculated sample size for correct responses.
- Width with 23 observations: The margin of error for a sample size of 23 448.
📝 When practicing, students should complete the exam before reviewing the model answers to effectively check their calculations, interpretations, units, conditions, and decisions 448.
18. How to succeed in this course
18.1 Course structure and routine
This course emphasizes a consistent weekly routine for success, rather than innate mathematical talent. The routine involves preparing before lectures, actively participating during lectures, and engaging with the material through reading and practice after class.
This structured approach ensures that lectures serve as a second exposure to concepts, allowing for deeper understanding and question-asking 449.
- Weekly routine benefits:
- Preparation makes lectures a review, not an introduction.
- Lectures focus on main ideas, questions, and self-testing.
- Full chapter material provides detailed steps, examples, and code.
- Reading lecture material after class reinforces learning.
- Answering recall questions on the same day aids memory retention.
- Review questions connect new material to previous lectures.
- Tutorials are most effective when students bring their own attempts, especially incorrect ones.
- Spaced practice is more beneficial than cramming before the exam 449.
18.2 Assessment and exam material
The exam material consists solely of the lecture content and tutorial exercises. Optional sections, often marked in grey, are not part of the exam and are intended for students seeking further detail or derivations 449.
- Exam format:
- Both QM Basic and QM Intermediate courses conclude with a single exam that accounts for 100% of the final grade.
- All exam questions are open-ended.
- QM Basic exam: 180 minutes, closed-book, written, with a formula sheet. Approved calculators include Casio FX-82 series and Texas Instruments TI-30 series (excluding TI-30X Pro).
- QM Intermediate exam: 120 minutes, taken in TestVision. Permitted resources include RStudio, Excel, the TestVision calculator, a simple pocket calculator, scrap paper, and the code sheet 450.
18.3 Grading and exams
Each exam is worth 100 points. The final grade is calculated by dividing the total points by 10 and rounding to the nearest half or whole grade.
A passing score is 55 points or more 451.
| Course | Exam | Resit |
|---|---|---|
| QM Basic | Tuesday 8 December 2026 | Monday 18 January 2027 |
| QM Intermediate | Thursday 17 December 2026 | Thursday 21 January 2027 |
Mock exams with model answers are provided for both courses within the textbook to aid preparation 451.
18.4 Weekly checklists and schedule
Printable weekly checklists are available to help students manage their workload. These are tailored to the specific structure of each week, whether it involves one or two lectures, or a lecture combined with a tutorial 451.
18.5 QM Basic: Two-lecture week
This structure applies to weeks 43, 45, and 47 451.
- Before Monday: Prepare videos and tasks for Monday's lecture.
- Monday: Attend lecture; in the evening, read lecture material and answer recall questions.
- Tuesday: Work on practice tasks for Monday's lecture and review questions from earlier lectures.
- Wednesday (around other sessions): Prepare videos and tasks for Thursday's lecture.
- Thursday: Attend lecture; in the afternoon, read lecture material and answer recall questions.
- Friday: Complete practice tasks for Thursday's lecture, summarize key takeaways in two sentences ("Make it yours"), and prepare for the following Monday 451.
18.6 QM Basic: Lecture-plus-tutorial week
This applies to weeks 44, 46, 48, and 49 452.
- Before Monday: Prepare for Monday's lecture.
- Monday: Attend lecture; read lecture material and answer recall questions.
- Tuesday: Complete practice tasks for Monday's lecture.
- Wednesday: Attempt tutorial tasks independently (AI is permitted following a specific protocol), noting any difficulties.
- Thursday: Attend tutorial (exam preparation session), bring completed attempts and identified sticking points. Redo unsolved tasks.
- Friday: Finish tutorial set independently, complete extra exercises from the Tilly bot, summarize learning ("Make it yours"), and prepare for the upcoming Monday 452.
18.7 QM Intermediate: Standard week
This structure applies to weeks with one Wednesday lecture 452.
- Monday or Tuesday (before lecture): Watch preparation videos, complete preparation questions, and perform R warm-up exercises, bringing the output to class.
- Wednesday: Attend QM lecture, bringing your laptop. In the evening, read lecture material and answer recall questions.
- Thursday or Friday (around other sessions): Complete practice tasks from after class, answer one review question from an earlier lecture, and summarize personal insights ("Make it yours") 452.
18.8 QM Intermediate: Tutorial week
This applies to weeks 45 and 48 453.
- Monday or Tuesday: Prepare for Wednesday's lecture. Attempt tutorial tasks related to earlier lectures, using AI according to the protocol, and note any difficulties.
- Wednesday: Attend QM lecture. In the evening, read lecture material and attempt tutorial tasks related to the day's lecture.
- Thursday: Attend tutorial (exam preparation session), bringing attempts and identified sticking points.
- Friday or weekend: Redo tutorial tasks that were incorrect, complete recall questions and practice tasks from Wednesday's lecture, and summarize learning ("Make it yours") 453.
18.9 Working with AI
AI tools, such as the course's Tilly bot, can be used effectively by following the "Attempt, Ask, Verify, Explain" protocol. This method ensures AI enhances, rather than replaces, the student's own skill development 453.
- Attempt: Try the task yourself first to identify where you are struggling.
- Ask: Request hints or guiding questions, not complete solutions.
- Verify: Check all answers against the provided data, course notation, and R output.
- Explain: Articulate the result in your own words. The course values your ability to work with data and output independently 453.
📝 A student uses AI to understand a statistical concept. They first attempt a practice problem, then ask the AI for a hint on a specific step they found difficult. They then verify the AI's suggestion against the course's R output and their own calculations before explaining the corrected approach in their notes 453.
19. R Refresher
19.1 If R or RStudio is not ready
This section serves as a refresher for R and RStudio, covering essential commands and workflows from the Programming for E&BI course. It is designed to help students quickly recall necessary functions for their current quantitative methods tasks 454.
- Installation and Interface: Ensure R and RStudio are properly installed and accessible.
- R as a Calculator: Basic arithmetic operations, understanding operator precedence, and using built-in functions are fundamental 454.
19.2 If you cannot reproduce your work
Maintaining reproducible work is crucial. This involves managing R scripts and project folders effectively 454.
- R Scripts: Learn to create, save, run, and correct R scripts to ensure your analyses can be replicated.
- Project Folders: Keep your project organized with dedicated folders for data, scripts, and outputs. Avoid relying on a working directory that is not portable 454.
📝 To check if a CSV file named "shark_tank_teaching.csv" exists in the "data" subfolder, you would use the command
file.exists("data/shark_tank_teaching.csv")454.
19.3 If the data will not load
Loading and handling data are common tasks. Familiarize yourself with the commands for reading data files and inspecting dataframes 454.
- Loading CSV: Use
read.csv()to load data from comma-separated value files. - R Packages: Some functionalities require specific R packages to be installed and loaded.
- Dataframes: Understand how to index and access data within dataframes 454.
| Command | Purpose |
|---|---|
| getwd() | Get the current working directory. |
| file.exists("data/shark_tank_teaching.csv") | Check if a file exists. |
| sharks <- read.csv("data/shark_tank_teaching.csv") | Load a CSV file into a dataframe named 'sharks'. |
| dim(sharks) | Display the dimensions (rows, columns) of the dataframe. |
| names(sharks) | List the names of the columns in the dataframe. |
19.4 If you forgot summaries or plots 455
Generating summary statistics and visualizations are key steps in data analysis 454.
- Summary Statistics: Use functions to quickly understand the distribution and central tendencies of your data.
- Introduction to Plotting: Basic plotting commands help visualize data patterns.
- Data Visualization with ggplot: The
ggplot2package offers powerful tools for creating sophisticated graphics. - Aggregating by Group: Summarize data based on specific categories or groups 454.
| Command | Description |
|---|---|
| nrow(sharks) | Returns the number of rows in the 'sharks' dataframe. |
| mean(sharks$deal_on_show) | Calculates the average of the 'deal_on_show' column. |
| median(sharks$description_words) | Finds the median value of the 'description_words' column. |
| table(sharks$season) | Creates a frequency table for the 'season' column. |
19.5 If regression commands are unfamiliar
Regression analysis is a core statistical technique. R provides straightforward commands for fitting and interpreting models 455.
- Model Fitting: The
lm()function fits linear models, specifying the outcome variable and predictors. - Model Inspection: Use
summary(),confint(),fitted(), andresiduals()to understand model performance and components. - Diagnostic Plots:
plot(model)generates standard plots to assess model assumptions. - Handling Missing Values: Be aware that
lm()excludes rows with missing values by default 455.
| Command | Output/Action |
|---|---|
| model <- lm(y ~ x1 + x2, data = my_data) | Fits a linear model with 'y' as the outcome and 'x1', 'x2' as predictors. |
| summary(model) | Provides detailed statistics including coefficients, p-values, R-squared, and F-test. |
| confint(model) | Calculates confidence intervals for the model coefficients. |
| fitted(model) | Returns the predicted values for each observation in the data. |
| residuals(model) | Returns the difference between observed and predicted values for each observation. |
| plot(model) | Generates diagnostic plots for the linear model. |
📝 To fit a linear model where 'y' is the outcome variable and 'x1' and 'x2' are predictors, using data from a dataframe named 'my_data', you would use the command
model <- lm(y ~ x1 + x2, data = my_data)455.
19.6 A quick return-to-R check
This exercise encourages hands-on practice to solidify understanding of R commands and their statistical interpretation 455.
- Execute Code: Run the provided R code snippets yourself.
- Explain Outputs: Articulate the meaning of each number or result generated by the code. If you can run the code but not explain the output, focus on strengthening your statistical understanding 455.
19.7 Making figures in R
Creating effective data visualizations is essential for communication. R offers tools to generate publication-quality graphs 456.
- Reproducible Figures: R code for all figures in this textbook is available, allowing you to recreate them.
ggplot2Package: While you don't need to writeggplot2code from scratch, understanding its principles is beneficial.- Installation: Install necessary packages like
ggplot2,lmtest, andsandwichfor advanced functionalities. - Graph Design Principles: Follow guidelines for clarity and impact: one message per graph, zero-based axes, limited color palettes, clear labels, and appropriate graph types 456.
| Design Principle | Recommendation |
|---|---|
| Message | One clear message per graph, stated in the caption. |
| Axes | Counts start at zero; use only one vertical axis. |
| Colors | Use few colors: one for data, one for contrast, one for a second group, grey for context. |
| Reference Values | Draw means, benchmarks, or zero lines as dashed lines with values labeled. |
| Labels | Place labels directly on the graph where possible; name axes with units. |
| Form | Choose the graph type that best fits the data (e.g., PMF as sticks, histogram with bins, model curve as a line). |
- Further Reading: Consult resources like "R for Data Science," "Data Visualization: A Practical Introduction," and "Fundamentals of Data Visualization" for deeper insights 456.
20. Mathematics Refresher
20.1 Numbers, proportions, percentages, and units
A proportion represents a part of a whole, calculated as the count in a category divided by the total count. To convert a proportion to a percentage, multiply it by 100. A change from 40% to 46% is a 6 percentage-point increase, which is also a relative increase.
It is crucial to maintain units throughout calculations; for instance, if equity is in percent and seasons are measured in seasons, a slope's units would be percentage points per season. Changing units, such as from dollars to thousands of dollars, alters the coefficient's size but not the fitted relationship 459.
20.2 Order of operations
Mathematical operations should be performed in a specific sequence to ensure accurate results. This order is:
- Brackets or parentheses: Operations within parentheses are performed first.
- Powers and roots: Exponentiation and root extraction follow.
- Multiplication and division: These operations are performed next, from left to right.
- Addition and subtraction: Finally, addition and subtraction are carried out, from left to right 459.
For example, the expression (12−8)/16 is evaluated by first performing the subtraction within the parentheses (12−8=4), then the square root (16=4), and finally the division (4/4=1). In programming languages like R, using ample parentheses can enhance clarity 459.
20.3 Equality, approximation, and inequalities 460
Various symbols are used to express mathematical relationships between values 460.
| Symbol | Read as |
|---|---|
| = | equals |
| ≠ | does not equal |
| ≈ | is approximately equal to |
| <, > | is less than, is greater than |
| ≤, ≥ | is less/greater than or equal to |
| ∈ | is an element of |
It is important to use the approximation symbol (≈) only when a value is not exact. For instance, if R output shows a probability of approximately 0.612, but the exact value is a fraction like 53, the fraction should be used 460.
Interval notation specifies ranges of values:
[a, b]includes both endpoints a and b.(a, b)excludes both endpoints a and b.(a, b]excludes a but includes b 460.
For continuous random variables, the inclusion or exclusion of endpoints in an interval does not affect the probability, as single points have zero probability 460.
20.4 Variables, functions, and graphs
A variable is a symbol that can represent different values. A function is a rule that assigns exactly one output value for each allowed input value.
In the notation FX(x)=P(X≤x), FX is the name of the cumulative distribution function (CDF), and x is the input value at which it is evaluated. The subscript X indicates which random variable the CDF describes 460.
In a graph, the horizontal axis typically represents the input or predictor variable, while the vertical axis shows the function's output or outcome. It is essential to read both axis labels and units before interpreting the graph's shape 460.
20.5 Straight lines, slopes, and intercepts
A straight line can be represented by the equation y=a+bx 460.
- a is the intercept, representing the value of y when x is zero.
- b is the slope, indicating the change in y for a one-unit increase in x 461.
The slope between two points (x1,y1) and (x2,y2) is calculated as b=x2−x1y2−y1. The sign of the slope indicates the direction of the relationship, and its magnitude depends on the units of both variables.
When x falls outside the observed range, the intercept may not have a meaningful interpretation 461.
20.6 Subscripts and indices
Subscripts are used to denote specific values or observations within a dataset. The notation xi signifies the value of variable x for the i-th observation.
For n observations, indices range from i=1 to n. In multiple regression, xij represents the value of predictor j for observation i.
It is important to distinguish between indices that number observations (e.g., i) and those that number predictors (e.g., j). Capital letters like Xi typically denote a random variable before sampling, while lowercase letters like xi represent its observed value 461.
20.7 Summation notation
The Greek letter sigma (Σ) is used to indicate summation, meaning "add up". The sample mean (xˉ) is calculated by summing all values and dividing by the number of observations (n): xˉ=n1∑i=1nxi.
For example, the sum of values 2, 5, and 8 is 2+5+8=15, and their mean is 315=5 461.
A weighted sum involves multiplying each value by its corresponding weight before adding the results. The expected value of a discrete random variable is a weighted sum where the probabilities serve as the weights: E[X]=∑x⋅pX(x) 461.
20.8 Powers, roots, and squared deviations
The square of a number x is x2, and the square root (x2) undoes the squaring of a non-negative number, resulting in ∣x∣. Squaring deviations from the mean has two key effects: it makes all signs positive, and it gives larger deviations more weight.
This property is fundamental to methods like variance calculation and least squares regression 462.
The variance is expressed in squared units, while its square root, the standard deviation, returns to the original units. The square-root rule states that the standard deviation of the sample mean (σ/n) and the standard error of the mean (s/n) are proportional to the square root of the sample size (n).
To halve either of these, the sample size must be multiplied by 4 462.
20.9 Degrees of freedom and t critical values
Degrees of freedom (df) represent the number of independent pieces of information available after estimating necessary quantities. For a one-sample t-procedure, the sum of deviations from the sample mean is always zero: ∑i=1n(xi−xˉ)=0.
If n−1 of these deviations are known, the last one is fixed by this condition, meaning the procedure effectively uses n−1 degrees of freedom 462.
The notation tα,df refers to a critical value from the t-distribution. For instance, t0.975,df leaves 2.5% of the probability in the right tail, making ±t0.975,df the critical values for a 95% two-sided procedure.
In R, this can be found using qt(0.975, df =...) . With fewer degrees of freedom, the t-distribution has heavier tails, resulting in larger critical values. As degrees of freedom increase, the t-distribution approaches the standard normal distribution.
In regression, if a model estimates an intercept and k slopes from n observations, the residual degrees of freedom are n−k−1 462.
20.10 Sets and event notation
A set is a collection of distinct elements. In probability theory:
- Ω represents the sample space, the set of all possible outcomes.
- A denotes an event, a subset of the sample space.
- Ac is the complement of event A, meaning "not A".
- A∪B is the union, representing "A or B, or both".
- A∩B is the intersection, representing "both A and B".
- ∅ is the empty event, an event with no outcomes 463.
In conditional probability, P(A∣B), the vertical bar signifies "given". The event after the bar (B) defines the reduced group of interest, and its probability serves as the denominator.
Two events are independent if P(A∣B)=P(A) or, equivalently, if P(A∩B)=P(A)P(B) 463.
20.11 Fractions and rearranging equations
Multiplying the numerator and denominator of a fraction by the same non-zero number does not alter its value. To solve an equation, apply identical operations to both sides.
For example, the equation z=σx−μ can be rearranged to solve for x: multiplying both sides by σ gives zσ=x−μ, and then adding μ to both sides yields x=μ+zσ. This rearrangement allows conversion between z-scores and raw values 463.
20.12 Standardisation and z-scores
A z-score quantifies how many standard deviations a specific value is away from the mean. It is calculated using the formula z=σx−μ, where x is the value, μ is the mean, and σ is the standard deviation.
A positive z-score indicates the value is above the mean, while a negative z-score means it is below the mean 463 464.
For example, if monthly sales have a mean (μ) of 200 units and a standard deviation (σ) of 40 units, sales of 260 units correspond to a z-score of z=40260−200=1.5. This means 260 units is 1.5 standard deviations above the mean. The formula x=μ+zσ can be used to convert back from a z-score to the original value.
This standardization form is also used in hypothesis testing and regression analysis, typically as (estimate - claimed value) / standard error 464.
20.13 Indicators and reference categories
An indicator variable, also known as a dummy variable, can only take values of 0 or 1. It is used to represent categorical variables in statistical models. For a binary variable D, if D=0, the model might yield a mean of β0; if D=1, the mean might be β0+β1.
The coefficient β1 then represents the difference in means between the group where D=1 and the group where D=0 464.
When dealing with G categories, G−1 indicator variables are typically used along with an intercept. One category is designated as the reference category, which does not have its own indicator variable 464.
20.14 Products, interactions, and combined effects
An interaction term in a model involves the product of two variables, such as XZ. In a model like Y=β0+β1X+β2Z+β3XZ+ϵ, the coefficient β1 represents the slope of X when Z=0, and β1+β3 represents the slope of X when Z=1.
It is crucial to interpret the combined effect of variables, especially when interactions are present, rather than interpreting coefficients in isolation 464.
Centering a variable involves replacing it with its deviation from the mean (e.g., Xc=X−Xˉ). When a variable is centered, its coefficient (e.g., β1 in the model above) often represents the effect of that variable when the other interacting variable is at its mean.
Centering changes some coefficients and their interpretations but does not alter the model's fitted values 464.
20.15 Polynomial terms
A quadratic function is a polynomial of degree two, typically expressed as y=β0+β1x+β2x2. Unlike linear functions, quadratic functions do not have a constant slope; the change in y for a one-unit increase in x depends on the value of x.
For example, the change from x to x+1 results in a change in y of β1+β2(2x+1). When graphing a quadratic function, it is advisable to calculate fitted values at meaningful points and plot the curve only within the observed range of the data.
In R formulas, squared predictors should be written as I(x^2) to ensure the squaring operation is performed correctly 465.
© 2026 Maeve. All rights reserved. This content is protected by copyright.