# Paired-samples t-test (/docs/analyses/ttest-paired)



## When to use it [#when-to-use-it]

Use this when each row is one person measured twice, and you want to know whether the average change is different from zero. For example: did anxiety scores fall from before a workshop to after it?

The independent-samples test is the wrong tool here, because the two scores are not from separate people.

## Assumptions [#assumptions]

The two columns are numeric, and each row is a matched pair. The test assumes the differences are roughly normal.

Tensr calculates a Jarque–Bera test on those differences and stores it on the result as `diagnostics.jarque_bera_statistic` and `diagnostics.jarque_bera_p_value`. The Paired Differences table does not print it, and there is no assumption note of the kind the independent-samples test shows. A Jarque–Bera p below .05 means the differences look non-normal. Use the [Wilcoxon signed-rank test](/docs/analyses/wilcoxon-signed-rank), or the [sign test](/docs/analyses/sign-test) if you only care about the direction of the change.

## Running it in Tensr [#running-it-in-tensr]

<Steps>
  <Step>
    Analyze → Compare Means → Paired-Samples T Test. In chat: “Paired t-test of before and after.”
  </Step>

  <Step>
    Put the first measurement in before column and the second in after column. The difference Tensr tests is before minus after.
  </Step>

  <Step>
    Confidence level starts at 0.95. There is no equal-variance option, because there is only one set of differences.
  </Step>
</Steps>

## Options [#options]

<TypeTable
  type="{
  before_column: {
    type: 'string',
    description: 'First measurement. The tested difference is this column minus after column.',
  },
  after_column: {
    type: 'string',
    description: 'Second measurement from the same cases.',
  },
  confidence_level: {
    type: 'number',
    description: 'Confidence level for the mean difference.',
    default: '0.95',
  },
  decimal_places: {
    type: '0–6',
    description: 'Report output. Decimal places.',
    default: '3',
  },
  apa_format: {
    type: 'boolean',
    description: 'Report output. APA-style tables.',
    default: 'true',
  },
  include_charts: {
    type: 'boolean',
    description: 'Report output. Draws a box plot titled “after vs before.”',
    default: 'true',
  },
}"
/>

## Reading the output [#reading-the-output]

Forty-eight people measured before and after a short course. The typical gain is a few points, and some people go the other way.

|                |   Mean |    SD |    SE | 95% CI low | 95% CI high |      t | df |    p |
| -------------- | -----: | ----: | ----: | ---------: | ----------: | -----: | -: | ---: |
| before - after | -3.808 | 7.843 | 1.132 |     -6.086 |      -1.531 | -3.364 | 47 | .002 |

Paired t-test comparing `before` and `after` on 48 paired rows (mean diff = -3.808, p = .002). The primary result is significant (p = .002). This is large enough, in this sample, to treat the comparison this page is about as a real association rather than noise. Metrics: Mean difference = -3.808; SD of differences = 7.843; SE mean difference = 1.132; 95% CI mean diff = \[-6.086, -1.531]; t statistic = -3.364; p-value = .002.

## Reporting (APA 7) [#reporting-apa-7]

Paired t-test comparing `before` and `after` on 48 paired rows (mean diff = -3.808, p = .002). This result is significant (p = .002). The effect is moderate, so report its size with the p-value.

## Coming from SPSS [#coming-from-spss]

Analyze → Compare Means → Paired-Samples T Test.

SPSS also prints the correlation between the two columns. Tensr’s Paired Differences table does not. SPSS does not print Cohen’s dz unless you ask for an effect size. Tensr always reports dz in the metrics.

## Related [#related]

[Wilcoxon signed-rank](/docs/analyses/wilcoxon-signed-rank) and the [sign test](/docs/analyses/sign-test) are the rank alternatives. Three or more repeated measurements belong on [repeated-measures ANOVA](/docs/analyses/anova-repeated).
