Lecture 5: Hypothesis Testing with z Tests
Overview of the Research and Data Analysis Pipeline
Analysis of behavioural data follows a structured flow from research question to dissemination.
Research Design and Planning (218 Content):
Development of research questions (e.g., "Is CBT effective for depression in Canadian youth?").
Conducting literature reviews to identify gaps in existing research.
Hypothesis development: Defining hypotheses and operationalizing variables.
Planning the study: Using effect size and power to calculate necessary sample size ( power typical).
Data Collection (217 Content):
Choosing an experimental design, such as a randomized controlled trial (e.g., CBT Group vs. Control Group).
Choosing recruitment methods (e.g., social media advertising).
Data Analysis (218 Content):
Choosing statistical tests (z-test, t-test, regression, ANOVA).
Running statistical analysis using software (e.g., SPSS).
Calculating descriptive and inferential statistics (e.g., change in depression scores).
Interpretation (218 Content):
Using knowledge of confidence intervals and effect sizes.
Considering replicability and generalizability (e.g., applying results outside of a specific region or social media user base).
Dissemination (217 Content):
Designing and presenting posters or writing papers.
Describing statistical results using APA format.
Criteria for Selecting Statistical Tests
z-Test:
Used when both the population mean () and the population standard deviation () are known.
Comparison is made between a sample mean () and a population mean () or a set value.
Single-Sample t-Test:
Used when the population mean () is known, but the standard deviation is unknown.
Independent-Samples t-Test:
Used when comparing different samples of participants (e.g., Treatment Group vs. Control Group).
Paired-Samples t-Test:
Used when comparing paired observations from the same sample of participants.
One-Way Between-Subjects ANOVA:
Used when comparing more than two samples of participants on one variable.
Two-Way (or higher) Between-Subjects ANOVA:
Used when comparing different samples of participants across two or more variables.
One-Way Within-Subjects ANOVA:
Used when comparing more than two sets of observations from the same sample.
Two-Way (or higher) Within-Subjects ANOVA:
Used when assessing two or more variables within the same sample.
Null Hypothesis Significance Testing (NHST)
NHST is a type of inferential statistical test used to test the Null Hypothesis ().
The Research Hypothesis ():
The hypothesis formulated by the researcher based on theory.
Also referred to as the "Alternative Hypothesis."
Example: "People taking the treatment will have lower symptoms than people not taking the treatment."
The Null Hypothesis ():
The negation of the research hypothesis.
Symbolized as .
and must be mutually exclusive and exhaustive.
Example: "People taking the treatment will NOT have lower symptoms than people not taking the treatment."
Outcomes of NHST:
Reject the null hypothesis.
Fail to reject the null hypothesis.
Rationale for testing (Falsification):
Observations consistent with a theory do not prove it (e.g., observing a million white swans does not prove "all swans are white").
One inconsistent observation (a black swan) allows for the rejection of a hypothesis.
Scientific advancement occurs by looking for observations that reject the negation of the research hypothesis (the null hypothesis).
The Process and Standard of Unlikelihood
The NHST Process:
Assume the null hypothesis is true.
Record observations.
Compare the observations to the distribution implied by the null hypothesis.
If the result is "very unlikely" under the assumption that is true, reject .
Alpha ():
The cutoff value for what is considered "very unlikely."
Traditionally, ().
If observations as extreme as the ones recorded would occur of the time or less by random chance (assuming is true), the null hypothesis is rejected.
Directionality: One-Tailed vs. Two-Tailed Tests
One-Tailed Test:
Used for directional hypotheses (e.g., "fertilizer increases pumpkin weight").
The alpha cutoff () is placed entirely in one tail of the distribution.
Two-Tailed Test:
Used for non-directional hypotheses (e.g., "light change makes pumpkins a different size").
The alpha is split between both tails: in the left tail and in the right tail (totaling ).
Traditional Standard:
Psychology traditionally uses two-tailed tests to prevent researchers from "cheating" by claiming a directional hypothesis after seeing results (HARKING).
Error Types in Hypothesis Testing
Type I Error:
Occurs when the null hypothesis is actually true, but the researcher erroneously rejects it.
Commonly called a "false positive."
If , the expected rate of Type I error when the null hypothesis is true is exactly .
Type II Error:
Occurs when the null hypothesis is false, but the researcher fails to reject it.
Commonly called a "false negative."
If the null hypothesis is true, a Type II error cannot occur (the chance is ).
z-Scores: Calculations and Percentiles
Characteristics of z-Score Distributions:
The mean of a z-score distribution is always .
The standard deviation () is always .
The shape (skew, etc.) is the same as the original raw scores.
Formula for Population z-Score:
Example: Pacific Spirit Park Tree Heights:
Given: , , tree height .
Calculation: .
Percentile Calculation:
A z-score of corresponds to the percentile ().
Probability of a tree being taller than is
Probability of a tree having a more extreme value (further from the mean in either direction) is (\text{)}.
The Distribution of Means
Definition: The sampling distribution generated by taking many samples of size from a population and recording their means in a histogram.
Key Properties:
If is large enough (usually ), the distribution of means will be a normal distribution, regardless of the population's shape.
The mean of the distribution of means () is equal to the population mean ().
The standard deviation of the distribution of means is called the Standard Error ().
Standard Error Formula:
The Standard Error is an indicator of how much error occurs when using a sample mean to estimate the population mean. It decreases as the sample size () increases.
The z-Statistic and the z-Test
The z-statistic applies the logic of the z-score to a distribution of means.
Formula for z-Statistic:
Assumptions of the z-Test:
The outcome variable is a continuous measure (otherwise use a nonparametric test).
Participants are randomly selected.
The population is normally distributed (or is large enough to rely on the central limit theorem).
Parametric vs. Nonparametric Tests:
The z-test is a parametric test, meaning it requires population parameters.
Nonparametric tests are used for nominal/ordinal data or extreme violations of normality.
Six Steps of Hypothesis Testing: Pumpkin Growth Example
Scenario: Fertilizer influence on pumpkin weight. Known population: , . Sample: , .
Identify Populations and Assumptions:
Population 1: All pumpkins (no fertilizer).
Population 2: All pumpkins (fertilizer).
State Hypotheses (Two-tailed):
Determine Characteristics of Comparison Distribution:
Determine Critical Values:
For (two-tailed), the critical values are .
Calculate Test Statistic (z-statistic):
Make a Decision:
Compare observed to critical .
Since 2.24 > 1.96, reject the null hypothesis.
Determining the p-Value: Caffeine and Extraversion Example
Scenario: Caffeine effect on extraversion ( scale). Population , . Sample: , . Alpha .
Hypotheses: ; .
Standard Error: .
Critical Value: For , two-tailed, critical .
z-Statistic: .
Decision: is more extreme than , so reject .
Calculate p-value:
The p-value is the decimal probability of observing a result as extreme or more extreme than observed, assuming is true.
Look up in the z-table.
.
To account for both tails (two-tailed test): .
In decimal notation: (rounded to ).
Conclusion: Since p < \alpha (0.02 < 0.05), the result is "statistically significant," and the null hypothesis is rejected.
Questions & Discussion
Question: If the and the null hypothesis is true, what is the expected rate of Type I error?
Response: It is exactly . Alpha defines the probability of rejecting the null hypothesis by chance when it is actually true.
Question: If the and the null hypothesis is true, what is the expected rate of Type II error?
Response: It is . Type II errors can only occur if the null hypothesis is false.
Question: If the values in our results have a mean with a z-statistic of , what percentage of means in the distribution are more extreme?
Response: Looking at the two tails, the value far beyond is very small. For , the percentage more extreme is approximately ( in each tail). Since 0.26\% < 5\%, we reject .