Z Test Calculator

Paired z test calculator

=—
—
—
Paired z-test visualizationSlope chart of each pair and a dot plot of the differences

    The working, step by step

      In plain words

      Assumption check

        What Is a Paired Z-Test?

        A paired z-test is a hypothesis test that checks whether the mean of paired differences (d̄) differs from a hypothesized value when the standard deviation of the differences (σd) is known.

        Each subject is measured twice, such as before and after a programme, or two matched subjects form one pair. The test works on the differences d = after − before, so the variation between subjects drops out. The paired z-test is part of the Z Test Calculator suite.

        Paired Z-Test Formula

        The paired z-test formula is z = (d̄ − Δ₀) / (σd / √n).

        z = (d̄ − Δ₀) / (σ_d / √n)

        Calculating the Differences (d)

        To calculate the differences, subtract the first measurement from the second for every pair: d = after − before. A weight that falls from 82 kg to 79 kg gives d = −3 kg (about −6.6 lb). The mean of the differences, d̄ = Σd / n, is the estimate the test uses.

        Z Statistic for the Mean Difference

        The z statistic divides d̄ − Δ₀ by the standard error σd / √n, where n is the number of pairs. Δ₀ is usually 0, meaning no change.

        When to Use a Paired Z-Test (Assumptions)

        Use a paired z-test when 4 conditions hold:

        1. Paired data: each value in one condition matches exactly one value in the other condition.
        2. Known σd: the standard deviation of the differences comes from earlier studies or a large pilot.
        3. Independent pairs: one pair does not influence another pair.
        4. Normal differences or many pairs: the differences are roughly normal, or there are at least 30 pairs.

        How to Use the Paired Z Test Calculator

        The paired z test calculator accepts 2 kinds of input.

        Entering Raw Before/After Data

        To enter raw data, select "Raw before/after values", then paste the before values and the after values in the same order. The calculator computes every difference, d̄ and the sample SD, and draws a slope chart with one line per subject. Select "Use sample SD as σd" when σd is unknown and there are at least 30 pairs.

        Entering Summary Values (d̄, σd, n)

        To enter summary values, select "Summary values", then type d̄, the number of pairs and σd. The graph switches to the sampling distribution of d̄ with the rejection regions shaded.

        Paired Z-Test Step by Step

        To run a paired z-test by hand, follow 6 steps:

        1. Compute d = after − before for each pair.
        2. Calculate d̄ = Σd / n.
        3. Calculate SE = σd / √n.
        4. Calculate z = (d̄ − Δ₀) / SE.
        5. Find the p-value for the chosen tail.
        6. Reject H₀ when p ≤ α.

        Interpreting Paired Z-Test Results

        A significant paired z-test means the average change across subjects differs from Δ₀. The sign of d̄ shows the direction: a negative d̄ with d = after − before means values fell. The confidence interval for the mean difference shows the plausible size of the change, and Cohen's dz = d̄ / σd shows the change in standard-deviation units. Check tail areas for any z with the z score to p-value calculator.

        Paired Z-Test Examples

        There are 2 worked examples below.

        Example 1: Weight Before and After a Programme

        30 people join a 12-week programme. The mean change is d̄ = −2.4 kg (about −5.3 lb), with σd = 4.0 kg from earlier programmes.

        1. Hypotheses
          H₀: μd = 0, H₁: μd < 0
        2. Standard error
          SE = 4.0 / √30 = 0.7303
        3. Z statistic
          z = −2.4 / 0.7303 = −3.286
        4. P-value
          p = P(Z ≤ −3.286) = 0.0005
        5. Decision
          Reject H₀: the programme lowers weight.

        Example 2: Test Scores Before and After Training

        25 employees take a skills test before and after training. The mean gain is d̄ = 3.1 points, with σd = 6.

        1. Hypotheses
          H₀: μd = 0, H₁: μd > 0
        2. Standard error
          SE = 6 / √25 = 1.2
        3. Z statistic
          z = 3.1 / 1.2 = 2.583
        4. P-value
          p = P(Z ≥ 2.583) = 0.0049
        5. Decision
          Reject H₀: training raises scores.

        Paired vs. Two-Sample Z-Test

        Use the paired z-test for 2 measurements on the same subjects, and the two-sample z-test for 2 separate groups. Treating paired data as independent ignores the link between measurements and inflates the standard error. Compare separate groups with the two sample z-test.

        Paired Z-Test vs. Paired T-Test

        Use the paired z-test when σd is known, and the paired t-test when the standard deviation of the differences comes from the sample. The paired t-test uses n − 1 degrees of freedom and suits small samples. Run it with the paired t-test option.

        FAQs

        Is a paired z-test the same as a one-sample z-test on the differences?

        Yes, a paired z-test is a one-sample z-test applied to the differences. The differences become one sample, d̄ plays the role of x̄, σd plays the role of σ and Δ₀ plays the role of μ₀. The two calculations give the same z and p-value.

        Does the order of subtraction (after − before) matter?

        No, the order of subtraction changes only the sign of z, not the p-value of a two-tailed test. after − before = −2.4 becomes before − after = +2.4. For a one-tailed test, flip the direction of H₁ to match the order you use.

        What happens if one value in a pair is missing?

        Drop the whole pair when one value is missing. A difference needs both measurements, so a lone before or after value adds no information. The calculator stops with a message when the two lists have different lengths.

        How many pairs do I need?

        A paired z-test needs about 30 pairs when the differences are not normal. To detect a change of 2 units with σd = 5, 80% power and α = 0.05, plan for about 50 pairs. Work out the exact number with the sample size calculator.

        Can I use a paired z-test for yes/no outcomes?

        No, paired yes/no outcomes need McNemar's test. McNemar's test looks at the pairs that changed from yes to no or from no to yes. Run it with the McNemar test.

        How do I report a paired z-test in APA format?

        Report a paired z-test as z = −3.29, p < .001, with the mean difference, the number of pairs and the confidence interval. Example: "Weight fell after the programme (Md = −2.4 kg, n = 30), z = −3.29, p < .001."