Probability Statistics

Cover

Chapter 7 ppt.pptx

📚 Chapter 7 ppt.pptx

Brief overview

This document introduces fundamental concepts of probability and the normal distribution. It outlines how to calculate probabilities and interpret statistical data using z-scores and related tables. Understanding these topics is crucial for statistical analysis and data interpretation.

Key points

  • Introduction to probability and its calculation methods.

  • Properties and characteristics of the normal distribution.

  • Converting raw scores to z-scores for standardized comparison.

  • Using z-scores and tables to determine probabilities and proportions.


1. Introduction to probability en The normal distribution

1.1 Probability basics

  • Probability: The chance of a specific outcome happening. It's a fraction of all possible outcomes.

  • Calculation: p(Outcome) = (Number of outcomes for the event) / (Total number of possible outcomes)

📝 Example: The probability of drawing a red card from a standard deck. There are 26 red cards out of 52 total cards. p(red) = 26 / 52 = 0.5

  • Range: Probabilities are always between 0 and 1 (or 0% and 100%).

    • 0 means the event never happens.

    • 1 means the event always happens.

Outcome Type

Probability Range

Never Occurs

p = 0 or 0%

Always Occurs

p = 1 or 100%

1.2 Playing card probability examples

  • A standard deck has 52 cards.

  • There are 4 suits (hearts, diamonds, clubs, spades) and 13 ranks (2-10, Jack, Queen, King, Ace) per suit.

  • There are 26 red cards (hearts, diamonds) and 26 black cards (clubs, spades).

📝 Example: Probability of drawing a 4. There are four 4s (one of each suit) in a 52-card deck. p(4) = 4 / 52 = 1/13

📝 Example: Probability of drawing a red 4. There are two red 4s (4 of hearts, 4 of diamonds). p(red 4) = 2 / 52 = 1/26

  • Sampling:

    • With replacement: The card is put back after drawing. Probabilities do not change for subsequent draws.

    • Without replacement: The card is not put back. Probabilities change for subsequent draws.

🔑 Important: When sampling without replacement, the total number of outcomes decreases with each draw.

1.3 The normal distribution

  • Normal distribution: A common, bell-shaped probability distribution.

  • Key properties:

    • Area under the curve: The total area under the curve always equals 1.00.

    • Symmetry: The curve is symmetric around its center.

    • Tails: The tails of the distribution approach the x-axis but never touch it (asymptotic).

    • Central Tendency: The mean, median, and mode are all equal in a perfect normal distribution.

🔑 Important: The normal distribution is a model for many natural phenomena and data sets.

1.4 The empirical rule

  • The empirical rule (or 68-95-99.7 rule) describes how data is spread in a normal distribution. It uses standard deviations (SD) from the mean.

Percentage of Data

Within Standard Deviations

Approximately 68%

Within 1 SD of the mean

Approximately 95%

Within 2 SD of the mean

Approximately 99.7%

Within 3 SD of the mean

Cover

Chapter 8A.pdf

Table of contents

  1. Chapter 8A: Interpreting Graphs & Tables

1. Chapter 8A: Interpreting Graphs & Tables

1.1 Types of graphs and data

This section introduces various graphical representations of data and the fundamental types of data used in analysis. Understanding these tools is crucial for interpreting quantitative information effectively 1 2.

  • Column Graph: Used to compare discrete categories or show changes over time for distinct items.
  • Pie Chart: Represents parts of a whole as percentages, illustrating proportions within a single dataset.
  • Line Graph: Displays trends and changes in data over a continuous interval, often used for time-series data.
  • Histogram: Similar to a column graph but used for continuous numerical data, showing the frequency distribution within specific intervals 1 2.

1.2 Data types

Data can be broadly classified into categorical and numerical types, each with specific characteristics 1.

  • Categorical data: Represents groups or qualities that cannot be measured numerically.
  • Numerical data: Represents measurable quantities.
  • Discrete data: Consists of distinct, countable values, often whole numbers.
  • Continuous data: Can take any value within a given range, including decimals and fractions 1.

📝 If the car owner spends $3,000 per year on petrol, the total amount spent on the car each year is $6,000 2.

1.3 Interpreting column graphs

Column graphs are useful for comparing quantities across different categories. They allow for quick identification of highest and lowest values and calculation of differences 1.

  • Example 1: This column graph represents the annual income of five different people.
  • (a) What is Aruvin’s annual income? Aruvin’s annual income is $60,000.
  • (b) What is the difference between Jami’s and Ashdev’s income? The difference between Jami’s and Ashdev’s income is $50,000.
  • (c) Who earns the most? Stefan earns the most at $90,000 1.

1.4 You Try

  • (d) What is Phong’s annual income? Phong’s annual income is $80,000.
  • (e) What is the difference between Stefan’s income and Jami’s income? The difference between Stefan’s income and Jami’s income is $10,000.
  • (f) Who earns the least? Ashdev earns the least at $40,000 1.

1.5 Interpreting pie charts

Pie charts visually represent the proportion of different categories within a whole dataset, often expressed as percentages 2.

  • Example 2: A car owner graphs the amount of money spent per year on car-related expenses.
  • (a) What is the smallest expense each year? The smallest expense each year is Maintenance, at 25%.
  • (b) What percentage of the car’s expenses is devoted to maintenance? Maintenance is 25% of the total.
  • (c) If the car owner spends $3000 per year on petrol, what is the total amount spent on the car each year? If the car owner spends $3,000 per year on petrol, the total amount spent on the car each year is $6,000 2.

1.6 You Try

  • (d) What is the largest expense each year? The largest expense each year is Petrol, at 50%.
  • (e) What percentage of the car’s expenses is devoted to petrol? Petrol is 50% of the total.
  • (f) If the car owner spends $1200 per year on maintenance, what is the total amount spent on the car each year? If the car owner spends $1,200 per year on maintenance, the total amount spent on the car each year is $4,800 2.

1.7 Interpreting histograms

Histograms display the frequency distribution of continuous data by dividing the data into intervals or bins. They help in understanding the shape and spread of the data 2.

  • Example 3: The following graph represents the heights of the trees on Fraser’s Farm.
  • (a) How many trees are between 100 and 200 cm tall? There are 30 trees between 100 and 200 cm tall.
  • (b) Which height interval contains the most trees? The height interval containing the most trees is 250-300 cm.
  • (c) What is the total number of trees on the farm? The total number of trees on the farm is 122 trees 2.
Cover

Chapter-9-Large-Sample Tests of Hypotheses_Part_1.pdf

1. Introduction to statistical hypothesis testing

Statistical hypothesis testing provides a structured framework for making decisions about a population based on sample data, by formally evaluating competing claims about a population parameter.

1.1 The core components of a hypothesis test

A statistical test of hypothesis is comprised of five fundamental elements:

  • The null hypothesis (H0H_0): This is a statement of no effect or no difference, representing the status quo or a baseline assumption.
  • The alternative hypothesis (HaH_a): This is the hypothesis that the researcher aims to support, typically representing a claim of effect, difference, or relationship. It is formulated as a contradiction to the null hypothesis.
  • The test statistic and its p-value: The test statistic is a single numerical value calculated from sample data that measures how far the sample result deviates from what would be expected if the null hypothesis were true. The p-value is the probability of observing a test statistic as extreme as, or more extreme than, the one calculated from the sample, assuming the null hypothesis is true.
  • The significance level and the rejection region: The significance level (α\alpha) is a predetermined probability threshold representing the maximum acceptable risk of incorrectly rejecting the null hypothesis. The rejection region is the set of values for the test statistic that would lead to the rejection of the null hypothesis.
  • The conclusion: Based on the comparison of the test statistic to the rejection region or the p-value to the significance level, one of two conclusions is reached: either reject H0H_0 in favor of HaH_a, or do not reject H0H_0.

Note: A statistical test of hypothesis begins with the assumption that the null hypothesis (H0H_0) is true. The goal is to use sample data to determine if there is sufficient evidence to reject this assumption in favor of the alternative hypothesis (HaH_a) 5.

1.2 Formulating null and alternative hypotheses

The null hypothesis (H0H_0) and alternative hypothesis (HaH_a) are the two competing statements that a statistical test aims to evaluate. The alternative hypothesis is typically the one the researcher wishes to support, while the null hypothesis is its contradiction 4.

Example 9.1 (Two-tailed test): A researcher wants to test if the average hourly wage of electricians in California is different from 21 dollars (the national average).

  • Alternative hypothesis: Ha:μ≠21H_a: \mu \neq 21
  • Null hypothesis: H0:μ=21H_0: \mu = 21 If H0H_0 is rejected, the conclusion is that the average hourly wage is not equal to 21 dollars 6.

Example 9.2 (One-tailed test): A process for sheet metal die cutting currently produces an average of 3% defectives. A researcher wants to show that an adjustment to the machine will decrease the proportion of defectives (pp).

  • Alternative hypothesis: Ha:p<0.03H_a: p < 0.03
  • Null hypothesis: H0:p=0.03H_0: p = 0.03 If H0H_0 is rejected, the conclusion is that the adjusted process produces fewer than 3% defectives. 7 8.

1.3 Understanding test statistics and p-values

To decide whether to reject or accept the null hypothesis, two key pieces of information derived from the sample data are used: the test statistic and its corresponding p-value 10.

  • Test Statistic: This is a single numerical value calculated from the sample data. It is typically based on the best available estimator for the population parameter being tested. The test statistic quantifies how much the sample result deviates from the null hypothesis expectation.
  • p-value: This is a probability calculated using the test statistic. It represents the likelihood of observing a test statistic as extreme as, or more extreme than, the one obtained from the sample, assuming that the null hypothesis is true.

Example 9.3 (Calculating test statistic and p-value): Consider testing if the average hourly wage of California electricians (μ\mu) is different from 21 dollars (H0:μ=21H_0: \mu = 21 vs. Ha:μ≠21H_a: \mu \neq 21). A sample of 100 electricians yielded a sample mean (xˉ\bar{x}) of 22 dollars with a sample standard deviation (ss) of 2 dollars. Assuming the null hypothesis is true (μ=21\mu = 21), the standard error of the mean is calculated as: SE=sn=2100=0.2SE = \frac{s}{\sqrt{n}} = \frac{2}{\sqrt{100}} = 0.2 11 12.

The test statistic (z-score in this case, due to the large sample size and the Central Limit Theorem) is calculated as: z=xˉ−μ0SE=22−210.2=5z = \frac{\bar{x} - \mu_0}{SE} = \frac{22 - 21}{0.2} = 5 13.

The sample mean of 22 is 5 standard errors above the hypothesized mean of 21. For a two-tailed test, the p-value is the probability of observing a z-score as extreme as 5 or more, or as extreme as -5 or less: p-value=P(z>5)+P(z<−5)≈0p\text{-value} = P(z > 5) + P(z < -5) \approx 0 14.

Cover

Chapter-9-Large-Sample Tests of Hypotheses_Part_1.pdf

1. Introduction to statistical hypothesis testing

Statistical hypothesis testing is a formal procedure used to make decisions about population parameters based on sample data, by systematically evaluating competing claims.

1.1 Components of a statistical test of hypothesis

A statistical test of hypothesis is a structured process composed of five key elements that guide the decision-making process.

  • Null Hypothesis (H0H_0): This is the statement of no effect or no difference that is assumed to be true initially. It represents the status quo or a baseline assumption.
  • Alternative Hypothesis (HaH_a): This is the hypothesis that the researcher wishes to support, typically representing a claim of an effect, difference, or relationship. It is a contradiction of the null hypothesis.
  • Test Statistic: A single numerical value calculated from the sample data that measures how far the sample result deviates from what would be expected if the null hypothesis were true. It is usually based on the best estimator for the parameter being tested.
  • P-value: The probability of observing a test statistic as extreme as, or more extreme than, the one calculated from the sample data, assuming the null hypothesis is true.
  • Significance Level (α\alpha) and Rejection Region: The significance level, denoted by α\alpha, is the probability of falsely rejecting the null hypothesis when it is actually true. It represents the maximum tolerable risk of a Type I error. The rejection region is a set of values for the test statistic that would lead to the rejection of the null hypothesis.

1.2 Formulating hypotheses

Hypotheses are formulated as competing statements about a population parameter. The null hypothesis (H0H_0) is the statement of equality or no effect, while the alternative hypothesis (HaH_a) is the statement that contradicts H0H_0 and is what the researcher aims to find evidence for.

  • Example: If a researcher wants to show that the average hourly wage of electricians in California is different from the national average of USD 21, the hypotheses would be:
    • HaH_a: μ≠21\mu \neq 21 (Alternative hypothesis)
    • H0H_0: μ=21\mu = 21 (Null hypothesis)
  • Example: If a process currently produces an average of 3% defectives and a researcher wants to show that an adjustment decreases this proportion, the hypotheses would be:
    • HaH_a: p<0.03p < 0.03 (Alternative hypothesis)
    • H0H_0: p=0.03p = 0.03 (Null hypothesis)

Important: The null hypothesis is always stated with an equality sign (==), whereas the alternative hypothesis can be stated with inequality signs (≠\neq, <<, or >>).

1.3 Types of hypothesis tests

Hypothesis tests are categorized based on the directionality of the alternative hypothesis, which dictates the location of the rejection region.

  • Two-tailed test: Used when the alternative hypothesis states that the parameter is simply not equal to the value specified in the null hypothesis (e.g., HaH_a: μ≠21\mu \neq 21). The rejection region is split between both tails of the distribution of the test statistic.
  • One-tailed test: Used when the alternative hypothesis specifies a direction of inequality.
    • Left-tailed test: The rejection region is in the left tail of the distribution (e.g., HaH_a: p<0.03p < 0.03). 15 9.
    • Right-tailed test: The rejection region is in the right tail of the distribution (e.g., HaH_a: μ>21\mu > 21).

1.4 Test statistics and p-values

To decide whether to reject or accept the null hypothesis, two crucial pieces of information are derived from sample data: the test statistic and its corresponding p-value.

  • Test Statistic: This is a single number computed from the sample data that quantifies the deviation from the null hypothesis. For example, when testing a hypothesis about a population mean μ\mu, the test statistic is often a z-score or a t-score.

    Example: For Example 9.3, testing H0:μ=21H_0: \mu = 21 versus Ha:μ≠21H_a: \mu \neq 21 with a sample mean xˉ=22\bar{x} = 22, a sample standard deviation s=2s = 2, and sample size n=100n=100: The standard error of the mean is calculated as: SE(xˉ)=sn=2100=0.2SE(\bar{x}) = \frac{s}{\sqrt{n}} = \frac{2}{\sqrt{100}} = 0.2 12.

    The test statistic (z-score) is then: z=xˉ−μ0SE(xˉ)=22−210.2=5z = \frac{\bar{x} - \mu_0}{SE(\bar{x})} = \frac{22 - 21}{0.2} = 5 13. This indicates the sample mean is 5 standard errors away from the hypothesized population mean.

  • P-value: This probability helps assess the evidence against the null hypothesis. It is the probability of observing sample results as extreme as, or more extreme than, those obtained, assuming H0H_0 is true.

    Example: For Example 9.3, since it is a two-tailed test, the p-value is calculated as the sum of the probabilities of observing a z-score of 5 or greater, and a z-score of -5 or less:

Cover

Chapter-9-Large-Sample Tests of Hypotheses_Part_2.pdf

1. Large-sample tests for the difference between two population means

This section outlines the methodology for conducting hypothesis tests on the difference between the means of two distinct populations when sample sizes are sufficiently large.

1.1 Introduction to large-sample tests for the difference between two population means

The Central Limit Theorem (CLT) establishes that for large sample sizes, the sampling distribution of the difference between two sample means (xˉ1−xˉ2\bar{x}_1 - \bar{x}_2) approximates a normal distribution. This approximation allows us to construct and perform hypothesis tests for the difference between two population means (μ1−μ2\mu_1 - \mu_2). A common hypothesis tested is whether the two population means are equal, i.e., H0:(μ1−μ2)=0H_0: (\mu_1 - \mu_2) = 0 3.

1.2 Formal procedure for large-sample tests

The formal procedure for testing hypotheses about the difference between two population means (μ1−μ2\mu_1 - \mu_2) when sample sizes are large involves several key steps:

  1. Null hypothesis (H0H_0): This hypothesis posits a specific value for the difference between the population means. It is typically stated as H0:(μ1−μ2)=D0H_0: (\mu_1 - \mu_2) = D_0, where D0D_0 is the hypothesized difference. For tests examining equality of means, D0=0D_0 = 0 4.
  2. Alternative hypothesis (HAH_A): This hypothesis contradicts the null hypothesis and can be directional (one-tailed) or non-directional (two-tailed).
    • One-tailed test: HA:(μ1−μ2)>D0H_A: (\mu_1 - \mu_2) > D_0 or HA:(μ1−μ2)<D0H_A: (\mu_1 - \mu_2) < D_0.
    • Two-tailed test: HA:(μ1−μ2)≠D0H_A: (\mu_1 - \mu_2) \neq D_0 5.
  3. Test statistic: The test statistic used for large-sample tests is the z-statistic, calculated as: z=(xˉ1−xˉ2)−D0s12n1+s22n2z = \frac{(\bar{x}_1 - \bar{x}_2) - D_0}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}} where:
    • xˉ1\bar{x}_1 and xˉ2\bar{x}_2 are the sample means.
    • s12s_1^2 and s22s_2^2 are the sample variances.
    • n1n_1 and n2n_2 are the sample sizes.
    • D0D_0 is the hypothesized difference.
  4. Rejection region: This region defines the values of the test statistic for which the null hypothesis is rejected.
    • One-tailed test: Reject H0H_0 if z>zαz > z_\alpha (for HA:(μ1−μ2)>D0H_A: (\mu_1 - \mu_2) > D_0) or if z<−zαz < -z_\alpha (for HA:(μ1−μ2)<D0H_A: (\mu_1 - \mu_2) < D_0).
    • Two-tailed test: Reject H0H_0 if z>zα/2z > z_{\alpha/2} or z<−zα/2z < -z_{\alpha/2}. Alternatively, rejection can be based on the p-value: reject H0H_0 if the p-value is less than α\alpha 6.

1.3 Assumptions for large-sample tests

For these large-sample tests to be valid, the following assumptions must be met:

  • The samples are randomly and independently selected from their respective populations.
  • The sample sizes are sufficiently large, typically n1≥30n_1 \geq 30 and n2≥30n_2 \geq 30 7.

1.4 Example: Car ownership and academic achievement

This example illustrates the application of a large-sample test to compare the mean grade point averages (GPAs) of student car owners and non-owners 8.

  • Scenario: Two random samples of 100 students each were selected: 100 non-owners and 100 car owners.
    • Non-owners: n1=100n_1 = 100, xˉ1=2.70\bar{x}_1 = 2.70, s12=0.36s_1^2 = 0.36.
    • Car owners: n2=100n_2 = 100, xˉ2=2.54\bar{x}_2 = 2.54, s22=0.40s_2^2 = 0.40.
    • Significance level: α=0.05\alpha = 0.05.
  • Hypotheses: To determine if there's a difference in mean academic achievement, the hypotheses are:
    • H0:(μ1−μ2)=0H_0: (\mu_1 - \mu_2) = 0 (no difference in mean GPA)
    • HA:(μ1−μ2)≠0H_A: (\mu_1 - \mu_2) \neq 0 (there is a difference in mean GPA) 9.
  • Calculation of the test statistic: z=(2.70−2.54)−00.36100+0.40100=0.160.0036+0.0040=0.160.0076≈0.160.08717≈1.84z = \frac{(2.70 - 2.54) - 0}{\sqrt{\frac{0.36}{100} + \frac{0.40}{100}}} = \frac{0.16}{\sqrt{0.0036 + 0.0040}} = \frac{0.16}{\sqrt{0.0076}} \approx \frac{0.16}{0.08717} \approx 1.84
  • Critical value approach: For a two-tailed test with α=0.05\alpha = 0.05, the critical values are z=±1.96z = \pm 1.96. Since −1.96<1.84<1.96-1.96 < 1.84 < 1.96, the null hypothesis cannot be rejected. 10 11.
  • P-value approach: The p-value is the probability of observing a test statistic as extreme as, or more extreme than, z=1.84z = 1.84 (in either tail). p-value=P(z>1.84)+P(z<−1.84)≈(1−0.9671)+0.0329=0.0329+0.0329=0.0658p\text{-value} = P(z > 1.84) + P(z < -1.84) \approx (1 - 0.9671) + 0.0329 = 0.0329 + 0.0329 = 0.0658 Since the p-value (0.06580.0658) is greater than the significance level (α=0.05\alpha = 0.05), H0H_0 cannot be rejected.
  • Conclusion: There is insufficient evidence to indicate a difference in the average academic achievements between car owners and non-owners at the 0.050.05 significance level. 12.
Cover

Chapter 9.pdf

📚 Chapter 9.pdf

Brief overview

This document introduces the core principles and methodologies of hypothesis testing. Understanding these concepts is crucial for drawing statistically valid conclusions from data and making informed decisions in research and analysis.

Key points

  • Introduction to the fundamentals of hypothesis testing, including null and alternative hypotheses and error types.
  • Conducting hypothesis tests for population means when population standard deviation is known.
  • Performing hypothesis tests for population means with unknown population standard deviation using the t-distribution.
  • How to conduct hypothesis tests for a population proportion using the standard normal distribution.
  • Advanced concepts including decision-making, calculating Type II error probabilities, and sample size determination.

1. Introduction to hypothesis testing

1.1 Developing null and alternative hypotheses

Hypothesis testing uses sample data to decide whether a statement about a population parameter is true.

  • Null hypothesis (H0H_0): A tentative assumption about a population parameter. It's the statement being challenged.
  • Alternative hypothesis (HaH_a): A statement that contradicts the null hypothesis. It's often what a researcher hopes to support.

The alternative hypothesis is often the research hypothesis.

1.2 When the alternative hypothesis is the research hypothesis

The researcher forms the alternative hypothesis (HaH_a) based on what they want to prove. The null hypothesis (H0H_0) is set up as the opposite, often representing the status quo or no effect.

  • Example: A new fuel injection system is being tested to see if it improves miles per gallon.
    • HaH_a: The new system increases miles per gallon (μ>24\mu > 24).
    • H0H_0: The new system does not increase miles per gallon (μ≤24\mu \le 24).

1.3 When the null hypothesis is an assumption to be challenged

The null hypothesis (H0H_0) represents an existing belief or assumption. The alternative hypothesis (HaH_a) challenges this assumption.

  • Example: A soft drink label claims 67.6 fluid ounces.

    • H0H_0: The mean filling weight is at least 67.6 ounces (μ≥67.6\mu \ge 67.6). (Manufacturer's perspective, challenging claims if underfilled)
    • HaH_a: The mean filling weight is less than 67.6 ounces (μ<67.6\mu < 67.6).
  • Example: Manufacturer's quality control for a 67.6-ounce bottle.

    • H0H_0: The mean filling weight is equal to 67.6 ounces (μ=67.6\mu = 67.6). (Process is working correctly)
    • HaH_a: The mean filling weight is not equal to 67.6 ounces (μ≠67.6\mu \ne 67.6). (Overfilling or underfilling is occurring)

The equality sign (==, ≤\le, or ≥\ge) always belongs in the null hypothesis (H0H_0).

1.4 Forms of null and alternative hypotheses for a population mean (μ\mu)

There are three possible forms for hypothesis tests concerning a population mean (μ0\mu_0 is the hypothesized value):

Null Hypothesis (H0H_0)Alternative Hypothesis (HaH_a)Test Type
μ≥μ0\mu \ge \mu_0μ<μ0\mu < \mu_0Lower Tail
μ≤μ0\mu \le \mu_0μ>μ0\mu > \mu_0Upper Tail
μ=μ0\mu = \mu_0μ≠μ0\mu \ne \mu_0Two-Tailed

1.5 Type I and Type II errors

Hypothesis testing uses sample data, which can lead to incorrect conclusions.

Errors can occur in hypothesis testing.

Population ConditionConclusion: Accept H0H_0Conclusion: Reject H0H_0
H0H_0 TrueCorrect ConclusionType I Error
HaH_a TrueType II ErrorCorrect Conclusion
  • Type I Error: Rejecting H0H_0 when it is true.

    • The probability of a Type I error is denoted by α\alpha (alpha), the level of significance.
    • Common values for α\alpha are 0.05 and 0.01.
  • Type II Error: Accepting H0H_0 when it is false (i.e., HaH_a is true).

    • The probability of a Type II error is denoted by β\beta (beta). This is not always controlled in significance tests.

"Do not reject H0H_0" is preferred over "accept H0H_0" because it acknowledges uncertainty and avoids the risk of a Type II error.

📝 Example: A drug manufacturer seeks FDA approval.

  • H0H_0: The drug is safe and effective.
  • HaH_a: The drug is not safe and effective.
  • Type I Error: Approving an unsafe/ineffective drug (rejecting H0H_0 when true).
Cover

Chi-Indep.pdf

Table of contents

  1. Pre-Class Video Chi-square Independence
  2. Bivariate Relationships
  3. Step 2 (visually): • Overall: • Expected by group:
  4. (Review): Independent or not?
  5. Step 1: Hypothesis
  6. Another Perspective
  7. Chi-square independence examples available.

1. Pre-Class Video Chi-square Independence

1.1 Example: Pneumonia and Vaccination Status

This section introduces the chi-square test of independence using an example to explore the relationship between pneumonia occurrence and vaccination status. The observed counts are presented in a contingency table, showing the number of individuals who were sick with pneumonia and their vaccination status.

  • Observed counts:
  • Sick with pneumonia and vaccinated: 138
  • Sick with pneumonia and unvaccinated: 77
  • No pneumonia and vaccinated: 166
  • No pneumonia and unvaccinated: 82
  • Total vaccinated: 84
  • Total unvaccinated: 166
  • Total sick with pneumonia: 23
  • Total no pneumonia: 248
  • Grand total: 271 1 3 5 6.

📝 The initial data presents a scenario where we want to determine if there's a relationship between getting pneumonia and whether someone has been vaccinated. The observed counts are: 138 individuals were sick with pneumonia and vaccinated, 77 were sick with pneumonia and unvaccinated, 166 had no pneumonia and were vaccinated, and 82 had no pneumonia and were unvaccinated 1 3.

1.2 Assumptions for Chi-Square Test

Before applying the chi-square test, certain assumptions must be met to ensure the validity of the results. These assumptions relate to the sampling method and the size of the sample.

  • Assumptions:
  • Random samples and independent observations: Data should be collected from random samples, and each observation must be independent of the others.
  • Large samples: The expected counts in all cells of the contingency table should be 5 or more. This ensures the chi-square distribution is a good approximation of the sampling distribution 2.

1.3 Null and Alternate Hypotheses

The chi-square test of independence is used to test specific hypotheses about the relationship between two categorical variables. The null hypothesis states there is no relationship, while the alternate hypothesis states there is a relationship.

  • Null Hypothesis (H0): Getting pneumonia is independent of vaccination status.
  • Alternate Hypothesis (Ha): Getting pneumonia is not independent of (or is related to or associated with) vaccination status 2.

1.4 Step 1: Fill in the Contingency Table

The first step in performing a chi-square test of independence is to organize the observed data into a contingency table. This table displays the frequencies for each combination of the two categorical variables.

  • The contingency table for the pneumonia and vaccination example includes the counts for individuals who were sick or not sick with pneumonia, categorized by their vaccination status 3 5.

1.5 Step 2: Calculate Expected Counts

This step involves determining the expected frequencies for each cell in the contingency table under the assumption that the null hypothesis is true (i.e., the variables are independent). The expected count for a cell is calculated by multiplying the row total by the column total and dividing by the grand total.

  • Marginal Distribution of Illness: To calculate expected counts, first determine the overall percentage of the sample that experienced the condition. For instance, if 23 out of 271 participants got pneumonia, the percentage is approximately 8.5%.

  • Percentage sick with pneumonia: 23 / 271 ≈ 8.5%

  • Percentage not sick with pneumonia: 248 / 271 ≈ 91.5% 4 5 6.

  • Calculating Expected Counts: The formula for expected count is: E=(Row Total)×(Column Total)Grand TotalE = \frac{(\text{Row Total}) \times (\text{Column Total})}{\text{Grand Total}}

  • Expected count for no pneumonia and vaccinated: (84×248)/271≈76.83(84 \times 248) / 271 \approx 76.83

  • Expected count for no pneumonia and unvaccinated: (166×248)/271≈151.17(166 \times 248) / 271 \approx 151.17

  • Expected count for sick with pneumonia and vaccinated: (84×23)/271≈7.17(84 \times 23) / 271 \approx 7.17

  • Expected count for sick with pneumonia and unvaccinated: (166×23)/271≈14.17(166 \times 23) / 271 \approx 14.17 5 6.

Cover

Chi_squared.pdf

1. Summary and interpretation

Chi-squared (χ2\chi^2) tests are powerful statistical tools used to analyze categorical data when dealing with three or more categories or assessing associations between categorical variables.

1.1 When to use a chi-squared test

Chi-squared tests are employed in various scenarios involving categorical data, categorized by the research question they address:

  • Goodness-of-Fit Test: Used to determine if the observed counts of a single categorical variable fit an expected distribution or model.
    • Example Question: Are four coffee brands equally preferred by consumers?
  • Test of Independence: Applied to assess whether two categorical variables are related or associated within a single population.
    • Example Question: Is gender associated with smoking status?
  • Test of Homogeneity: Used to compare the distribution of a categorical variable across two or more distinct populations.
    • Example Question: Do party preferences differ across provinces?

Example Application:

  • Scenario (a): Testing if car quality is affected by the day of the week built involves comparing observed defect counts across Monday-Friday to an expected uniform distribution. This is a Goodness-of-Fit test. .
  • Scenario (b): Investigating if political leaning is related to the choice of major in students involves analyzing two categorical variables within one population. This is a test of Independence. .
  • Scenario (c): Comparing course choice distributions between residential and nonresidential students requires examining a categorical variable across two groups. This is a test of Homogeneity. 5.

1.2 Key assumptions and general statistic

All chi-squared (χ2\chi^2) tests are subject to several critical assumptions to ensure the validity of the results:

  • Data Type: The data must consist of counts, not percentages or proportions.
  • Independence: Observations within the sample must be independent of each other.
  • Expected Counts: The expected count for each category or cell must be at least 5. If this condition is not met, categories may need to be combined.

The general statistic for chi-squared tests is calculated as:

χ2=∑(O−E)2E\chi^2 = \sum \frac{(O - E)^2}{E}

where:

  • OO represents the observed count in a category or cell.
  • EE represents the expected count in that same category or cell under the null hypothesis (H0H_0). 6.

1.3 General interpretation of the chi-squared statistic

The core principle behind chi-squared tests is to compare the observed frequencies of data with the frequencies that would be expected if the null hypothesis were true.

  • Large Differences: If the differences between the observed (OO) and expected (EE) counts are substantial, it suggests that the observed data are unlikely to have occurred by random chance under the null hypothesis.
  • Chi-Squared Distribution: When the null hypothesis (H0H_0) is true and the sample size is sufficiently large, the calculated χ2\chi^2 statistic approximately follows a chi-squared distribution with a specific number of degrees of freedom (df). .

Tip: The magnitude of the χ2\chi^2 statistic should be interpreted in the context of the degrees of freedom. A larger χ2\chi^2 value, relative to its degrees of freedom, provides stronger evidence against the null hypothesis. 7.

2. Goodness-of-fit test en Test of independence

This section details two types of chi-squared tests: the goodness-of-fit test, used to assess if observed data fits a theoretical distribution, and the test of independence, used to determine if two categorical variables are related within a single population.

2.1 Goodness-of-fit chi-squared test

The goodness-of-fit chi-squared test is employed to determine whether an observed frequency distribution differs significantly from an expected theoretical distribution. This test is particularly useful when dealing with a single categorical variable.

2.1.1 Application and hypothesis formulation

The primary goal is to assess if the observed counts in different categories align with what would be expected under a specific hypothesis about the population proportions.

  • Null Hypothesis (H0H_0): The observed data fits the specified theoretical distribution (e.g., all categories are equally likely). For a fair die, H0:p1=p2=⋯=p6=1/6H_0: p_1 = p_2 = \dots = p_6 = 1/6.
  • Alternative Hypothesis (HAH_A): The observed data does not fit the specified theoretical distribution (i.e., at least one proportion is different). For a fair die, HAH_A: Not all probabilities are 1/61/6.

2.1.2 Calculating expected counts

Under the assumption of the null hypothesis, the expected count for each category is calculated by multiplying the total number of observations (nn) by the hypothesized probability for that category.

Cover

Chi-Squared .pdf

📚 Chi-Squared .pdf

Brief overview

This document details the Chi-Square test, a statistical method used to analyze categorical data. Understanding this test is crucial for determining relationships between variables and assessing the fit of observed data to theoretical expectations, particularly in fields like genetics.

Key points

  • Overview of the Chi-Square test for independence and its hypotheses.

  • Step-by-step calculation of the Chi-Square statistic using observed and expected values.

  • Interpretation of Chi-Square results via degrees of freedom and critical values.

  • Application of the Chi-Square test for goodness of fit in genetic crosses.

  • Structured guide to performing a complete Chi-Square test from hypothesis to interpretation.


1. Introduction to the chi-square test for independence

1.1 Purpose of the chi-square test

The Chi-Square Test for Independence determines if there is a significant association between two variables. It helps decide if observed differences in data are due to chance or a real relationship.

1.2 Hypotheses

The test evaluates two opposing hypotheses.

  • Null Hypothesis (H_0H\_0): There is no significant association between the variables. They are independent. Any observed association is due to random chance or sampling error.

  • Alternative Hypothesis (H_aH\_a): There is a significant association between the variables. The observed association is unlikely to be due to chance.

1.3 Calculating the chi-square test

The calculation involves several steps, starting with data collection and ending with comparing a calculated value to a critical value.

1.3.1 Data collection and contingency table

  • Collect data: Gather raw counts for the occurrence of each variable combination. This is often done using random sampling methods, such as quadrants in ecological studies.

  • Contingency table: Organize the raw counts into a table. These counts are called observed values (OO).

📝 Example: A study might count the number of quadrants containing Species A only, Species B only, both species, or neither.

Species B Present

Species B Absent

Total

Species A Present

3

1

4

Species A Absent

1

0

1

Total

4

1

5

1.3.2 Calculating expected values

  • Expected values (EE): Determine the counts you would expect if the two variables were truly independent.

  • Formula: Expected frequency = (Row Total times\\times Column Total) / Grand Total.

📝 Example: For the cell "Species A Present" and "Species B Present": E=(4times4)/5=3.2E = (4 \\times 4) / 5 = 3.2

Species B Present

Species B Absent

Total

Species A Present

3.2

Cover

CHYS 3P15 Lecture 2.docx

Table of contents

  1. Describing and graphing data
  2. Standard deviation
  3. Degrees of freedom (DF)

1. Describing and graphing data

1.1 Model testing and hypotheses

The goal of quantitative research is to build models that represent real-world phenomena. These models are tested using statistical methods, which help assess the likelihood that observed results are due to chance or a meaningful effect.

This process involves formulating hypotheses.

  • Null hypothesis (H0): This hypothesis states that there is no effect or no difference between variables. Statistical tests are often designed to evaluate the probability of the null hypothesis being true.
  • Alternative hypothesis (H1): This is the experimental hypothesis, proposing that there is an effect or a difference. It can be directional, predicting the specific direction of the effect (e.g., higher academic achievement with more study time).

1.2 Levels of measurement

Understanding the level of measurement for variables is crucial for choosing appropriate statistical analyses and interpreting data.

LevelDescriptionExample
IntervalEqual intervals on the variable represent equal differences in the property being measured. No absolute zero; can have negative values.Temperature
RatioSame as interval, but ratios of scores make sense. Absolute zero signifies absence of the property; no negative values.Number of siblings

1.3 Types of variation

Variation in data can be attributed to specific experimental manipulations or unknown factors.

  • Systematic variation: Differences in performance directly caused by a specific experimental manipulation.
  • Unsystematic variation: Differences in performance due to unknown factors such as age, gender, IQ, time of day, or measurement error. Randomization is used to minimize this type of variation.

1.4 Continuous versus categorical data

The type of data collected influences the types of questions that can be asked and the statistical analyses that can be performed.

  • Categorical data: Provides limited information, such as counts or percentages within groups. It is typically visualized with bar graphs and analyzed for the mode.
  • Continuous data: Allows for more detailed analysis, providing information about measures of central tendency, distribution (skewness, kurtosis), and spread. Histograms with a normal curve are often used to visualize continuous data.

1.5 Measures of central tendency

Measures of central tendency describe the typical value in a dataset.

  • Mode: The most frequent score in a dataset. A dataset can be bimodal (two modes) or multimodal (several modes), indicating a deviation from a normal distribution.
  • Median: The middle score when the data is ordered. It is not influenced by outliers, making it a robust measure.
  • Mean: The sum of all scores divided by the number of scores. It is highly influenced by extreme scores (outliers). When the mean, median, and mode differ significantly, it suggests the data is skewed.

1.6 The mean as a statistical model

The mean serves as a simple statistical model to represent the typical score in a dataset. It is the value from which the sum of squared deviations is minimized, indicating how well the average represents the data.

1.7 Calculating error: Deviations

Error in a model is quantified by deviations, which are the differences between individual data points and the mean. A smaller deviation indicates a better fit of the model to the data.

  • Deviation: Calculated by subtracting the mean from each individual score (score−meanscore - mean). Deviations can be positive (score above the mean) or negative (score below the mean).

1.8 Calculating error: Sum of errors

The sum of errors is the simplest way to quantify total deviation. However, this sum is always zero because positive and negative deviations cancel each other out.

1.9 Calculating error: Sum of squared errors

To overcome the issue of deviations canceling out, each deviation is squared before being summed. This results in the Sum of Squared Errors (SS).

Squaring ensures all values are positive, providing a non-zero measure of total variability.

1.10 Calculating error: Variance

Variance (s2s^2) is the average of the squared errors. It is calculated by dividing the Sum of Squared Errors (SS) by the number of scores minus one (n−1n-1).

The use of n−1n-1 (degrees of freedom) is a correction factor for estimating population variance from a sample.

1.11 Calculating error: Standard deviation

Standard deviation (ss) is the square root of the variance. It is a more interpretable measure of variability because it is in the same units as the original data.

It represents the average amount by which individual scores differ from the mean, indicating how well the mean represents the sample data.