lecture 1-corrected
1. Course introduction and hypothesis testing fundamentals
This section summarizes the introductory material covering the course outline, the fundamental procedure of statistical hypothesis testing, and a detailed review of the one-sample t-test, including its non-parametric alternative, the Wilcoxon Signed-Rank test.
1.1 Course Outline and Lecture Overview
The course, HLST 2302 3.0 Statistical Methods in Health Studies II, begins by introducing the structure of the course and immediately delves into statistical concepts. The first lecture focuses specifically on the One-sample t-test and differentiates between parametric tests and their non-parametric counterparts. Subsequent topics scheduled include comparisons between two groups, independent t-tests, paired t-tests, and effect size calculations using Cohen's d 2 5.
1.2 Recap of Hypothesis Testing Fundamentals
Hypothesis testing is the primary method of statistical inference used to ascertain whether an observed difference between samples, or between a sample and a known population value, is attributable to random sampling error or reflects a genuine underlying effect. This method relies on establishing two competing hypotheses: the null hypothesis (H0), which posits no effect, no difference, or no association, and the alternative (research) hypothesis (H1), which reflects the investigator's belief. The entire process is designed to use information derived from a carefully selected sample to draw reliable conclusions about the entire target population 6.

The standardized steps for executing a hypothesis test are as follows 12 7:
- State the null hypothesis (H0) and the alternative hypothesis (H1).
- Select an appropriate test statistic and determine its corresponding sampling distribution.
- Compute the value of the test statistic using the collected sample data.
- Calculate the p-value and compare this value against the pre-determined significance level, α.
- Formulate a conclusion, deciding whether to reject or fail to reject the null hypothesis.
1.3 Review of the One-Sample t-Test
The one-sample t-test is employed to determine if the mean (xˉ) calculated from a single sample significantly deviates from a hypothesized population constant (μ) when the true population standard deviation (σ) is unknown.
Example: An investigator tests if the mean weight of men in 2006 (μ) is greater than the reported 2002 mean of 191 pounds.
- H0: μ=191
- H1: μ>191
Given a sample (n=100) with a mean xˉ=197.1 and a sample standard deviation s=25.6, with α=0.05. The test statistic calculation proceeds as follows:
z=nsxˉ−μ0=10025.6197.1−191=2.566.1=2.38
The resulting p-value is calculated as P(xˉ>197.1)=1−P(z<2.38)=1−0.9913=0.0087. Since p-value=0.0087<α=0.05, the null hypothesis is rejected 8.

The key characteristic defining the t-distribution, used in the one-sample t-test, is its degrees of freedom (df), which for this test is calculated simply as df=n−1. The t-distribution is a continuous probability model that resembles the standard normal distribution but adjusts its shape based on the sample size via the degrees of freedom.

A critical assumption of the t-test is that the variable of interest is approximately normally distributed in the population. Although the sample size in the previous example (n=100) is large enough that the t-distribution closely approximates the z-distribution, the t.test() function in R is still appropriately used for this scenario9.
Tip: When n is large (e.g., n≥30), the t-distribution converges rapidly toward the standard normal (z) distribution, meaning the choice between using z-test formulas or the t-test function yields nearly identical results.
1.4 Selection of Test Statistic and Critical Values
The choice between a z-test and a t-test often relates to whether σ is known. However, when determining critical values for testing or constructing confidence intervals, the distribution shape is paramount. For instance, critical values define the boundaries of rejection regions corresponding to specific confidence levels (α).

For a 95% confidence interval, the critical z-values are ±1.96, leaving 2.5% in each tail (α/2=0.025). Conversely, for a 90% confidence interval, the critical z-values are ±1.645, leaving 5% in each tail 10.
1.5 Non-Parametric Alternatives
When the assumption of approximate normality for the outcome variable cannot be reasonably met, especially with small sample sizes, the parametric one-sample t-test is inappropriate. In such cases, the Wilcoxon Signed-Rank test is used as the non-parametric equivalent for a one-sample test. This test offers an alternative by comparing the median of the sample against the specified fixed median value, rather than comparing the mean. Further details on non-parametric methods are slated for the following lecture 11.

2. Choosing the appropriate statistical test
The selection of the appropriate statistical test is a systematic process determined by several key characteristics of the research design and data, including the number of groups being compared, the relationship between those groups, the scale level of the variable of interest, and whether the data meets the assumptions for parametric testing. Statistical tests are broadly divided into parametric tests, which assume data normality and homogeneity of variance, and non-parametric tests, which are used when these assumptions are violated or the data is ordinal.
Tip: Many parametric tests are robust to minor violations of normality, especially with large sample sizes (n≥30), due to the Central Limit Theorem (CLT). If there is doubt, performing both parametric and non-parametric tests and checking for consistent conclusions is advisable.
2.1 Parametric versus Non-parametric considerations
Parametric tests rely on specific assumptions about the population distribution, such as normality and homogeneity of variance. If these assumptions are significantly unmet, or if the data is ordinal (categorical rank data), non-parametric alternatives must be employed 13.
- Parametric Tests: Assume underlying population parameters (e.g., mean, variance) can be estimated and that the data comes from a normally distributed population.
- Example: T-tests.
- Non-parametric Tests: Do not rely on stringent distribution assumptions and are suitable for ordinal data or small samples where normality cannot be assumed.
- Example: Mann-Whitney U test.

2.2 Defining the Research Question and Hypothesis
Before selecting a test, researchers must clearly define their comparison and potential directional prediction. Statistical tests address the null hypothesis (H0), which posits no difference exists between groups, with any observed difference attributed to sampling error.
- Two-tailed test: Used when researchers predict a significant difference exists but cannot specify the direction (e.g., Group A = Group B). This divides the rejection region (α) equally on both tails of the distribution.
- One-tailed test: Used when researchers specifically predict the direction of the difference (e.g., Group A > Group B). The entire rejection region (α) is concentrated on one side of the distribution curve 14.

2.3 Key Decision Factors for Test Selection
The choice of the correct statistical technique hinges on a sequential evaluation of the study design characteristics 16:
- Number of Samples/Groups/Conditions: Are you comparing one sample, two samples, or three or more?
- Type of Variable: Is the variable of interest measured on a scale (interval/ratio) or ordinal scale?
- Data Distribution: Is the data normally distributed (parametric) or not (non-parametric)?
- Relationship Between Samples: Are the samples independent (different subjects in each group) or related/repeated measures (same subjects measured multiple times)?
When faced with a statistical question, these factors guide the decision tree 17:
- How many groups am I comparing?
- Are these groups independent or repeated?
- What is the variable of interest (scale or ordinal)?
- If scale, is the population distribution known (if not, check sample size n)?
Comprehensive tables summarize these decision paths, categorizing tests based on group count and data dependency/type.


2.4 Test Selection Based on Group Comparison Structure
Statistical tests are chosen based on how many points of comparison are present (one, two, or three or more) and whether the data permits parametric analysis.
Two Groups Comparison
For comparing exactly two groups, the choice depends on data dependency and parametric assumptions:
- Two Independent Groups, Scale Data (Parametric): Independent Samples t-test. If data are not normal and n<30, the non-parametric alternative is the Mann-Whitney U test.
- Two Repeated/Paired Groups, Scale Data (Parametric): Paired Samples t-test (or Dependent t-test). If assumptions fail, the Wilcoxon Signed-Rank Test is the non-parametric alternative.
Example: Comparing the length of stay (scale variable) between male (n=106) and female (n=94) patients suggests an Independent t-test because the groups are independent and n≥30 (allowing reliance on CLT robustness) 18.
Example: Comparing blood pressure (scale variable) taken at 8AM versus 8PM in the same patients (n=73) requires a Paired t-test because the measures are from the same group (repeated) 19.
Three or More Groups Comparison
When comparing three or more groups, Analysis of Variance (ANOVA) techniques are typically used, again with parametric and non-parametric options available.
- Independent Groups, ≥3 Groups (Parametric): One-Way ANOVA. If assumptions fail or data is ordinal, the Kruskal-Wallis ANOVA is used.
Example: Comparing resource intensity weight (scale) across short, medium, and long-stay hospitalizations (three independent groups, n=25 each). Since n<30, the Kruskal-Wallis ANOVA is selected 20.
- Repeated Measures, ≥3 Groups (Parametric): One-Way Repeated Measures ANOVA. The non-parametric equivalent is Friedman's ANOVA.
Example: Comparing Timed Up and Go (TUG) scores across four time points (initial, interim1, interim2, final) for the same residents (n=150). This requires a One-Way Repeated Measures ANOVA due to four repeated groups and large sample size [n≥30] 23.
One Group Comparison
When comparing a single sample mean or median against a known standard or hypothetical value:
- If comparing a single sample's scale variable against a known value, and n<30, the Wilcoxon Signed-Rank Test might be appropriate if normality assumptions are suspect, as suggested in an example where n=26 21.
2.5 Considering Data Scale Level
The measurement scale of the variable of interest fundamentally restricts the test choice, regardless of group structure.
- If the variable is scale (interval or ratio), parametric tests like t-tests or ANOVA are preferred if assumptions hold.
- If the variable is ordinal (ranked data), non-parametric tests must be used.
Example: Comparing sex differences in Likert scale responses (ordinal) across two independent groups (males and females) requires the Mann-Whitney Test, as Likert data is not typically treated as normally distributed scale data 22.


3. Independent samples t-test and effect size calculation
The independent samples t-test is utilized to determine if there is a statistically significant difference between the means of two separate, unrelated groups, contrasting with the one-sample t-test which compares a single group mean to a known population mean. This test helps assess the signal (difference between means) relative to the noise (variability within the data).
Conceptual basis and hypothesis formulation
The independent samples t-test is conceptually designed to answer the question: Is there a difference between two distinct groups? For example, in a study comparing an intervention group (Cohort 1) to a control group (Cohort 2) on memory scores, the goal is to see if the intervention had an effect 24.
The hypotheses are formulated as:
- Null Hypothesis (H0): The population means are equal, μ1=μ2, meaning μ1−μ2=0.
- Alternative Hypothesis (H1): The population means are different (or specifically, one is greater than the other, μ1>μ2).
Example: If Cohort 1 is the intervention group and Cohort 2 is the control group, the hypotheses might be H0:μ1=μ2 and H1:μ1>μ2 25.

Calculating the t-statistic
The t-statistic quantifies the difference between the two means relative to the variability in the data, often described as the signal-to-noise ratio. A higher t-value suggests a larger signal relative to the noise, leading to a potentially significant result 26.
When testing the difference between two independent sample means, the t-statistic is calculated using the difference in sample means divided by the standard error of the difference.
The general structure mirrors the Z-statistic, but uses sample estimates for population parameters: t=SExˉ1−xˉ2xˉ1−xˉ2.
When the null hypothesis (μ1−μ2=0) is true, the t-statistic simplifies to: t=Spn11+n21xˉ1−xˉ2 28.
Here, Sp represents the pooled standard deviation, which is computed as a weighted average of the standard deviations from the two samples 27.

The sign of the resulting t-value depends on the order in which the groups are coded; swapping the group assignments (e.g., making Control Group 1 and Intervention Group 2) will flip the sign of t while keeping the p-value identical.
Assumptions and Levene's Test
Several assumptions must be met to appropriately use the standard independent samples t-test:
- The outcome variable must be approximately normally distributed within each population.
- The variances (σ2) in the two populations must be equal (homogeneity of variances).
If the data violates the assumption of equal variances, statistical software like R will automatically default to Welch's variation of the t-test, which corrects for unequal variances 29.
To formally test the homogeneity of variances assumption, Levene's test is performed. The null hypothesis for Levene's test states that the variances across all groups are equal.
- If Levene's test is significant (p<0.05), the assumption is violated, and Welch's t-test (unequal variances assumed) must be used.
- If Levene's test is non-significant (p>0.05), the assumption holds, and the standard t-test assuming equal variances is appropriate.
In an example run of Levene's test, the resulting p-value was 0.7211, leading to the conclusion that the variances were not significantly different, thus justifying the use of the t-test assuming equal variances 31.

Tip: Always check the homogeneity of variances assumption first using Levene's test before interpreting the results of the standard t-test, as this dictates which version of the test is valid 30.
Interpretation of the t-test output
Once the appropriate test is run (e.g., assuming equal variances, df=n1+n2−2), the output provides the t-statistic and the associated p-value.
For the example data, the output yielded t=3.3003 with degrees of freedom df=18 and a two-tailed p-value of 0.003979.
When a specific directional hypothesis (one-tailed) is stated (H1:μ1>μ2), the two-tailed p-value reported by software must be halved to obtain the correct p-value for the intended test. Halving the example p-value gives 0.0019895. Since this value is less than the typical alpha level of 0.05, the null hypothesis is rejected, concluding that the intervention group had significantly higher mean memory scores 33.

Confidence Intervals and Effect Interpretation
In addition to the p-value, the 95% Confidence Interval (CI) for the mean difference provides insight into the magnitude and plausible range of the true effect size. For an observed mean difference of 4.10 (13.1−9.0), the 95% CI was reported as [1.49,6.71].
A critical interpretation point regarding CIs:
- If the confidence interval does not contain zero, it indicates that the true difference between the means is unlikely to be zero, supporting the conclusion of statistical significance (p<0.05).
- If the CI includes zero (i.e., spans from negative to positive values), the true difference could plausibly be zero, suggesting the results are not statistically significant (p>0.05).
The output clearly displays the sample estimates, such as xˉintervention=13.1 and xˉcontrol=9.0.
Example: The statistical output showed a t-statistic of 3.3003, a p-value of 0.003979, and a 95% CI for the mean difference of [1.490004,6.709996] 34.

When re-running the analysis with the coding reversed (Control group coded as 1, Intervention group as 2), the t-statistic changes sign to −3.3003, but the corresponding p-value remains 0.003979 35.
</document_content>
4. Effect size reporting and paired t-test
This section details the necessity and calculation of standardized effect sizes, specifically Cohen's d, and introduces the paired t-test as the appropriate inferential statistical method for analyzing dependent or matched samples.
4.1 Standardized Effect Size Reporting (Cohen's d)
Statistical significance alone (i.e., the p-value) does not convey the practical importance or magnitude of a finding, especially when comparing results across studies that use different measurement scales. To compare the magnitude of effects consistently, mean differences must be converted into standardized effect sizes, such as Cohen’s d, Glass’ g, or Pearson’s r. This summary focuses on Cohen's d 36.
Cohen's d standardizes the mean difference by dividing it by a measure of variability, making the result unit-free and comparable across different studies or scales.
Calculating Cohen's d
One common method for calculating Cohen’s d involves three conceptual steps:
- Subtract mean 2 from mean 1.
- Calculate the average of the standard deviations (SDs) of the two groups.
- Divide the result from Step 1 by the result from Step 2.
If groups are independent, an alternative is to pool the standard deviations of the two groups using a specific equation 38.
Tip: When interpreting Cohen's d, remember that the resulting value signifies how many standard deviations the means differ by 37.
Interpreting Cohen's d Guidelines
Cohen provided widely accepted guidelines for interpreting the magnitude of the standardized effect size:
- d<0.2: Negligible effect
- 0.2≤d<0.5: Small effect
- 0.5≤d<0.8: Medium effect
- d≥0.8: Large effect
For example, a raw mean difference of 10.27 might seem large, but a corresponding Cohen’s d of only 0.38 indicates a rather small effect size 39.
4.2 Comprehensive Reporting of Statistical Results
Standard practice dictates a comprehensive structure for reporting inferential test statistics, which must include both the test statistic outcome and an effect size estimate. The five essential components for reporting results are:
- Descriptive statistics for each group (e.g., means and standard errors).
- The finding to which the test relates, including the test statistic itself.
- The degrees of freedom (df).
- The p-value associated with the test statistic.
- An estimate of the effect size (e.g., Cohen’s d).
To obtain comprehensive descriptive statistics beyond basic functions, packages like "pastecs" can be used to generate detailed summaries, including the Standard Error of the Mean (SE), which represents the standard deviation of the sample means 40 41.
Example: A report might state: "Results showed that, on average, the intervention group scored higher on memory (M=13.10, SE=0.78) than the control group (M=9.00, SE=0.97). The mean difference between the two groups, 4.10, 95% CI (1.49, 6.71), was statistically significant t=3.30, p=.003979; and represented a large-sized effect, d=1.48." 18 42.
The descriptive statistics for two cohorts might look like the following summary:

And the supporting details for calculating standard error of the mean (SE) are based on the sample standard deviation (s):

4.3 The Paired t-test
The paired t-test is specifically designed for situations where samples are dependent, meaning the data consists of difference scores (d) derived from matching observations (e.g., same subject measured twice, or matched pairs) This test assesses whether the population mean of these difference scores, denoted μd, is significantly different from zero.
Conceptual Distinction: The paired t-test compares the same group across two time points (indicated by the clock), contrasting with the one-sample test (comparing a group to a fixed value/globe) or the independent samples test (comparing two distinct, unrelated groups) 43.

Calculation of the Paired t-statistic
The t-statistic for a paired t-test is calculated using the sample mean difference (xˉd) and the standard error of the difference scores (sd/n) 44.
The general formula for the t-statistic is: t=sd/nxˉd−μd
Given that the null hypothesis (H0) posits no difference, μd=0. This simplifies the resulting t-statistic calculation to the mean difference divided by the standard error of the difference: t=sd/nxˉd

Paired t-test Example and Reporting
Consider an example where 23 participants' Verbal IQ (viq) and Performance IQ (piq) scores are compared. The hypotheses might be set as H0:μd=0 and H1:μviq−μpiq<0. The order of subtraction in the t-test function (e.g., viq – piq vs. piq – viq) determines the sign of the resulting mean difference and t-value 45.
The sample data illustrating the paired scores is presented below:

If the analysis yields a t-value of −0.76548 with df=22 and a two-tailed p-value of 0.4521, the negative t-value indicates that the mean of the first condition (viq) was smaller than the mean of the second (piq).

If the hypothesis was one-tailed, the p-value would be halved (0.4521/2=0.22605). Since this p-value is greater than the standard α=0.05, the null hypothesis is not rejected, suggesting no significant difference between viq and piq scores 46.
To fully report the findings, Cohen's d must also be calculated for the paired data, often using software functions like cohensD(). Descriptive statistics like mean and standard error for both paired variables can be generated using functions like stat.desc() combined with cbind() 47 48.
A typical reporting statement for this non-significant result, including effect size (d=0.16), would be: "Although the difference between the groups was in the expected direction (viq M=110.52,SE=2.62; piq M=112.22,SE=1.96), results showed that this difference, −1.70, 95% CI (−6.29,2.90) was not statistically significant t=−.77, p=.22605; and represents a negligible effect, d=.16." 22 49.
Application Note: The paired t-test is appropriate when assessing pre- and post-intervention measurements on a normally distributed variable for the same group of subjects 51.
Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
© 2026 Maeve. All rights reserved. This content is protected by copyright.