# One-sample t-test (/docs/analyses/ttest-one-sample)



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

Use this when you have one numeric column and a fixed comparison value, not two groups. For example: is the mean anxiety score in this sample different from the scale’s neutral point of 10?

## Assumptions [#assumptions]

The scores are numeric, and the sample mean is a fair summary (no extreme outliers doing all the work). The test assumes the scores are roughly normal, or that the sample is large.

Tensr does not run Shapiro–Wilk or any other normality check inside this procedure. Run [Shapiro–Wilk](/docs/analyses/shapiro-wilk) yourself if you need it. There is no effect-size field and no Cohen’s d on the result.

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

<Steps>
  <Step>
    Analyze → Compare Means → One-Sample T Test. In chat: “One-sample t-test of anxiety against 10.”
  </Step>

  <Step>
    Put the numeric column in value column.
  </Step>

  <Step>
    Type the comparison value in hypothesized mean. The API requires it. The dialog starts that box at 0, which is a poor default for a 0–20 anxiety scale. Confidence level starts at 0.95.
  </Step>
</Steps>

## Options [#options]

<TypeTable
  type="{
  value_column: {
    type: 'string',
    description: 'Numeric column to test.',
  },
  hypothesized_mean: {
    type: 'number',
    description: 'The comparison value, μ₀. Required. The dialog prefills 0.',
  },
  confidence_level: {
    type: 'number',
    description: 'Confidence level for the interval around the sample mean.',
    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 histogram titled “Distribution of” the outcome.',
    default: 'true',
  },
}"
/>

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

The same 96 exam scores, tested against a department target of 71. The class was built to land near that target, so a difference of a point or two is the result to read.

|       |     t | df |    p | Mean diff | 95% CI low | 95% CI high |
| ----- | ----: | -: | ---: | --------: | ---------: | ----------: |
| score | 0.466 | 95 | .643 |     0.395 |     -1.289 |       2.078 |

One-sample t-test of `score` against μ = 71 on 96 rows (mean diff = 0.395, p = .643). The primary result is not significant (p = .643). This is not large enough to treat the comparison this page is about as a reliable association. The result is non-significant: the data are still compatible with no effect. Metrics: t statistic = 0.466; p-value = .643; df = 95; Sample mean = 71.395; SE mean = 0.848; Mean diff = 0.395.

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

One-sample t-test of `score` against μ = 71 on 96 rows (mean diff = 0.395, p = .643). This result is not significant (p = .643). Report the estimate with that p, and do not describe the pattern as a reliable effect.

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

Analyze → Compare Means → One-Sample T Test.

SPSS prints Cohen’s d when effect sizes are requested. Tensr does not compute one for this test.

## Related [#related]

Two groups use the [independent-samples t-test](/docs/analyses/ttest-independent). A before-and-after design uses the [paired-samples t-test](/docs/analyses/ttest-paired). Check the shape of the scores with [Shapiro–Wilk](/docs/analyses/shapiro-wilk) or [descriptives](/docs/analyses/descriptives).
