HomeAll CategoriesOne Sample t Test Calculator, Free with Steps | StatsUnlock

One Sample t Test Calculator, Free with Steps | StatsUnlock

One Sample t Test Calculator

Paste comma-separated numbers, upload a CSV or Excel file, or enter summary statistics, and test whether a sample mean differs from a hypothesized value. You get the t statistic, degrees of freedom, p-value, confidence interval, Cohen's d with its own interval, normality checks, four charts and copy-ready APA wording.

Hypothesis TestParametricOne Groupp-Value & CICohen's dFree Online

⚡ 0. Quick Answer

A one sample t test calculator tests whether the mean of one sample differs from a known or hypothesized value μ₀, using t = (x̄ − μ₀) ÷ (s ÷ √n) with n − 1 degrees of freedom.

For 16 leaves with mean 52.44 mm and SD 4.19 mm tested against 50 mm, t(15) = 2.32 and p = 0.035, so the mean is significantly above 50 mm. Cohen's d is 0.58, a medium effect.

t = (x̄ − μ₀) ÷ (s ÷ √n)  ·  df = n − 1

Rule of thumb: reject H₀ when p is below α (usually 0.05), which happens when |t| is larger than the critical value, about 2.13 at df = 15 and 2.04 at df = 30. Always report the 95% confidence interval and Cohen's d beside p.

Key takeaways

  • A one sample t test compares one sample mean with one fixed value, such as a label claim, a norm or a published mean.
  • The test statistic is the mean difference divided by the standard error, and it has n − 1 degrees of freedom.
  • In the worked example, t(15) = 2.32, p = 0.035, 95% CI 50.20 to 54.67 mm, so 50 mm sits just outside the interval.
  • Cohen's d = 0.58 tells you how big the difference is in standard deviations, which p alone never does.
  • The test needs independent observations and roughly normal data; with n of 30 or more it is robust to mild skew, but not to heavy outliers.

📚 1. What Is a One Sample t Test?

A one sample t test tests whether the mean of a single continuous variable differs significantly from a known or hypothesized population mean. It assumes normality and requires only one group of independent observations. You use it when you have one set of measurements and one number to compare them with.

What it measures. The test asks a simple question: is the gap between your sample mean and the target value bigger than random sampling would usually produce? It answers by dividing that gap by the standard error of the mean. The standard error shrinks as n grows, so the same gap becomes more convincing with more data. The result, t, counts how many standard errors the sample mean sits away from μ₀.

A worked one-liner: 16 leaves average 52.4375 mm with SD 4.1947 mm. The standard error is 4.1947 ÷ 4 = 1.0487 mm. The gap from 50 mm is 2.4375 mm, so t = 2.4375 ÷ 1.0487 = 2.32 on 15 degrees of freedom, which gives p = 0.035.

45505560Leaf length, mmμ₀ = 50x̄ = 52.44gap 2.44 mm-4-2024t = 2.32±2.13t, df = 15
Left: the 16 leaf lengths, their mean (green) and the hypothesized 50 mm (dashed). Right: the t distribution with 15 df. The observed t of 2.32 falls beyond the critical value of 2.13, inside the shaded rejection region.

Who uses it. Quality engineers test whether a production line still meets a label claim. Clinicians compare a patient group with a reference value such as 120 mmHg. Teachers compare a class with a national average. Ecologists test whether stream pH departs from neutral, or whether a population's mean body mass differs from a published value. In every case there is one sample and one benchmark.

A one sample t test vs a two sample t test. The one sample t test has one group and a fixed number. A two sample t test has two groups and compares their means with each other. A paired t test is a one sample t test run on the differences between paired measurements, tested against 0.

TestComparesUse it when
One sample t testOne sample mean vs a fixed value μ₀σ is unknown and the data are roughly normal
One sample z testOne sample mean vs a fixed valueThe population σ is truly known
Wilcoxon signed-rank testOne sample median vs a fixed valueData are skewed, ordinal or have outliers
Paired t testMean of paired differences vs 0The same units are measured twice
Independent samples t testTwo group meansTwo separate groups, no fixed benchmark

🧮 2. Set Up Your Data

Dataset 1 is loaded. Nothing is computed until you press Run.
Each group is tested against the same μ₀. Commas, spaces, tabs, semicolons and new lines all work as separators.
Supports .csv, .txt, .xlsx and .xls. The first row is read as column names.

Type one value per cell. Each column becomes a group, and the header cell is its editable name. Empty cells are ignored.

Only have the mean, SD and n from a paper or report? Enter them here. The t test, CI, Cohen's d and power are exact. Normality checks and the data charts need raw values, so they are skipped.

While this tab is open, Run uses these summary statistics instead of the raw data.

The fixed value you compare with: a norm, label claim, target or published mean.
Used in the report sentences. Left blank, the group name is used.

📊 3. Results

Enter or load your data above, then press Run One Sample t Test. The t statistic, p-value, confidence interval, effect size, assumption checks, four charts and auto-filled reporting sentences will appear here.

🧠 4. Interpretation of Results, In Detail

Run the analysis above to fill the first five sub-sections with your own numbers: t = ___, df = ___, p = ___, d = ___. The sub-sections after them explain every part of the output.

4.6 How to interpret one sample t test results, in order

Read the output in this order, and you will not be fooled by any single number. First look at the mean difference, x̄ − μ₀, in real units. That is the actual finding. Then look at the confidence interval for the mean. If μ₀ lies outside the interval, the two-tailed test is significant at the matching α. Then read t and p, which tell you how surprising the difference would be if H₀ were true. Finally, read Cohen's d, which says whether the difference is large enough to matter.

A good one-sentence reading of any result has all four parts: the direction, the size in units, the evidence, and the effect size. For the leaf example: "Leaves were 2.44 mm longer than the published 50 mm on average (95% CI 0.20 to 4.67 mm above), t(15) = 2.32, p = 0.035, d = 0.58."

4.7 What the p-value does and does not mean

The p-value is the probability of getting a t at least this far from zero if the true mean were exactly μ₀. A p of 0.035 means a gap this large would turn up in about 3.5% of samples drawn from a population whose mean really is 50 mm. It is not the probability that H₀ is true, and it is not the probability that your result is due to chance. Those two misreadings are the most common errors in published research (Greenland et al., 2016).

A p just under 0.05 is weak evidence, not proof. A p of 0.049 and a p of 0.051 describe almost identical data. Treat p as a continuous measure of evidence, and let the interval and the effect size carry the story (Wasserstein & Lazar, 2016).

4.8 Statistical significance vs practical significance

With a big enough sample, a trivially small difference becomes significant. In Example 6 below, 2,500 test scores average 100.75 against a norm of 100. The test gives p = 0.012, but d = 0.05, a negligible effect that no teacher would notice. The reverse also happens: a small pilot study can show a large, important difference that is not significant only because n is small. Always ask two questions: is it real (p and the CI), and does it matter (d and the difference in units)?

4.9 Effect size bands for Cohen's d

Cohen's d for a one sample t test is (x̄ − μ₀) ÷ s. Cohen's (1992) bands are a starting point: about 0.2 is small, 0.5 medium, 0.8 large. They are not laws. In clinical blood pressure work a d of 0.3 can be important, while in a manufacturing process a d of 0.3 may be well inside tolerance. Hedges' g applies a small-sample correction and is slightly smaller than d when n is small. The calculator gives both, and a 95% interval for d based on the noncentral t distribution, so readers can see how precisely the effect is known.

4.10 One-tailed or two-tailed?

A two-tailed test asks whether the mean differs from μ₀ in either direction. A one-tailed test asks only about one direction, such as "greater than". For the same data, the one-tailed p is half the two-tailed p when the effect is in the predicted direction. That is exactly why a one-tailed test must be chosen before you see the data. Choosing the tail after looking doubles your real false-positive rate. If you cannot defend in advance why the other direction is impossible or irrelevant, use two tails.

4.11 Normality and robustness

The one sample t test assumes the population is roughly normal. In practice it is fairly robust: with 30 or more observations, mild skew barely changes the p-value, because the sampling distribution of the mean becomes close to normal (Lumley et al., 2002). Two problems still hurt at any size: heavy outliers and strong skew in small samples. That is why the calculator runs the Shapiro-Wilk test, reports skewness and flags outliers, and also runs a Wilcoxon signed-rank test as a check. If the t test and the Wilcoxon test disagree, trust neither blindly, and look at chart 3 and chart 4.

4.12 Power and sample size

Power is the chance the test detects a real difference of a given size. The calculator reports the power of your design to detect an effect as large as the one observed, and the n needed to reach 80% power for that effect. Treat the first number with care: power computed from the observed effect adds nothing to the p-value (a significant result always has observed power near or above 50%). The second number is more useful, because it tells you how big the next study should be. For planning, about 34 observations give 80% power to detect d = 0.5 at α = 0.05, two-tailed.

4.13 Several groups against one value

If you test several groups against the same μ₀, as in the stream pH sample with three sites, each test has its own 5% false-positive risk. With three tests, the chance of at least one false positive rises to about 14%. The calculator adds a Holm-adjusted p-value for each group so you can control this. Testing each group against μ₀ is also not the same as comparing the groups with each other. For that, use a one-way ANOVA.

4.14 Decision guide

What you seeWhat it meansWhat to report
p < α, |d| ≥ 0.5, normality OKA clear and meaningful difference from μ₀t, df, p, CI and d, with the direction in words
p < α, |d| < 0.2Real but very small difference, often from a large nLead with the effect size and say it is negligible
p ≥ α, CI is wideThe study cannot tell; too little dataSay the result is inconclusive and give the n needed
p ≥ α, CI is narrow around μ₀Good evidence the mean is close to μ₀Report the CI, consider an equivalence test (TOST)
Shapiro-Wilk p < 0.05 and n < 30Normality is doubtful in a small sampleReport the Wilcoxon signed-rank test as well
t test and Wilcoxon disagreeOutliers or skew are driving the meanInspect charts 3 and 4, report the median, justify the choice

4.15 Common mistakes this calculator prevents

  • Using the population SD. The calculator always uses the sample SD with n − 1, the same as Excel's STDEV.S and R's sd().
  • Wrong degrees of freedom. df is always n − 1 for a one sample t test, never n.
  • Reporting p without a CI or effect size. Every run returns the interval for the mean, the interval for the difference and Cohen's d with its own interval.
  • Halving p by hand. One-tailed p-values are computed directly from the t distribution in the right direction, so a result in the wrong direction is never reported as significant.
  • Ignoring skew and outliers. Normality, skewness, outliers and a Wilcoxon cross-check are reported on every run.
  • Silent data errors. Text, blanks and stray symbols are flagged, and the count n is shown so you can confirm what was used.

✍ 5. How to Write Your Results in Research

When reporting one sample t test results in APA format, give the test value, the mean and SD, t with its degrees of freedom, the exact p-value, the confidence interval and an effect size. The five templates below fill themselves with your numbers after you press Run.

▶ Run the analysis above to auto-fill all five examples with your results.

5.1 APA 7th edition results sentence

Example 1, APA 7th Edition
A one-sample t-test showed that the mean (M = ___, SD = ___) was ___ the test value of ___, t(___) = ___, p = ___, 95% CI [___, ___], d = ___.
📌 Key conventions for this style
  • Italicise M, SD, t, p and d.
  • Give degrees of freedom in brackets: t(15).
  • Report exact p to two or three decimals; write p < .001 only below 0.001.
  • No leading zero for p, because it cannot exceed 1: p = .035.
  • Keep the leading zero for d, because it can exceed 1: d = 0.58.

5.2 Thesis or dissertation paragraph

Example 2, Thesis / Dissertation
A two-tailed one-sample t-test was used to compare the sample mean with the hypothesized value of ___. ___
📌 Key conventions for this style
  • Say where μ₀ came from: a standard, a published mean, a regulation.
  • State how normality was checked and what you found.
  • Justify a one-tailed test if you used one, and say it was planned in advance.
  • Name the software and version used.

5.3 Plain-language summary

Example 3, Plain-Language Summary
We measured ___ items. On average they came to ___, which is ___ the target of ___.
📌 Key conventions for this style
  • No symbols: write "on average", not M.
  • Give the difference in real units.
  • Say how sure we are, using the confidence interval in words.
  • Say whether the difference is large or small in practice.

5.4 Structured abstract or conference poster

Example 4, Structured Abstract / Poster
Methods: one-sample t-test against ___. Results: M = ___ (SD ___), n = ___; t(___) = ___, p = ___; d = ___.
📌 Key conventions for this style
  • Keep it to one line per heading.
  • Put the CI in brackets right after the mean difference.
  • On a poster, put chart 1 next to this line.
  • Round to two decimals unless your measurements are more precise.

5.5 Replication or pre-registration statement

Example 5, Replication / Pre-Registration
Hypothesis: the population mean differs from ___. Test: one-sample t-test, α = ___, ___ alternative. ___
📌 Key conventions for this style
  • Fix μ₀, α and the tail before data collection.
  • State the smallest effect of interest and the planned n.
  • State the outlier rule and the fallback test if normality fails.
  • Give the observed effect so future studies can plan their power.

5.6 How to write up a one sample t test: tables, figures and the discussion

Methods wording. Name the test, the test value and where it came from, the tail, α, and how assumptions were checked. Example: "Mean leaf length was compared with the published species mean of 50 mm using a two-tailed one-sample t-test (α = .05). Normality was assessed with the Shapiro-Wilk test."

Tables. A results table for a one sample t test usually has the columns n, M, SD, μ₀, mean difference, 95% CI, t, df, p and d. Use one row per variable or group. Keep decimals consistent down each column.

Figures. The clearest figure is chart 1: the raw points, the mean with its CI as an error bar, and a dashed line at μ₀. State in the caption that the error bar is a 95% confidence interval, not an SD.

Discussion sentence. Interpret the size, not just the significance: "Leaves in this population were about 2.4 mm (5%) longer than the published mean, a medium-sized difference that may reflect the wetter growing season."

5.7 Reporting checklist

  • ✓ Test value μ₀ and its source
  • ✓ n, mean and SD
  • ✓ t, df and exact p, with the tail stated
  • ✓ 95% CI for the mean or the mean difference
  • ✓ Cohen's d (or Hedges' g for small n)
  • ✓ How normality and outliers were checked

∑ 6. Formulas Used

These are the one sample t test formula and every formula behind the results above. Each one uses the leaf example: n = 16, x̄ = 52.4375 mm, s = 4.1947 mm, μ₀ = 50 mm.

①
One Sample t Statistic
t = (x̄ − μ₀) ÷ (s ÷ √n)
tTest statistic, unitless: how many standard errors the mean is from μ₀
x̄Sample mean, in the units of the data
μ₀Hypothesized or known population mean, same units
sSample standard deviation, n − 1 denominator
nNumber of observations
Example(52.4375 − 50) ÷ (4.1947 ÷ 4) = 2.3243
②
Mean, Standard Deviation and Standard Error
x̄ = Σx ÷ n  ·  s = √[Σ(x − x̄)² ÷ (n − 1)]  ·  SE = s ÷ √n
ΣxSum of all values: 839 for the leaf data
Σ(x−x̄)²Sum of squared deviations: 263.9375 mm²
SEStandard error of the mean, in data units: 1.0487 mm
RuleDivide by n − 1, not n. Using n gives the population SD and inflates t
③
Degrees of Freedom and Critical Value
df = n − 1  ·  tcrit = t1−α/2, df (two-tailed) or t1−α, df (one-tailed)
dfDegrees of freedom for a one sample t test: 16 − 1 = 15
tcritCut-off from the t distribution: 2.1314 at df = 15, α = 0.05, two-tailed
αSignificance level, the false-positive rate you accept, usually 0.05
RuleReject H₀ when |t| > tcrit. Here 2.3243 > 2.1314
④
p-Value from the t Distribution
ptwo = 2 × P(Tdf ≥ |t|)  ·  pgreater = P(Tdf ≥ t)  ·  pless = P(Tdf ≤ t)
TdfA random variable that follows Student's t distribution with df degrees of freedom
pProbability, 0 to 1, of a t this extreme if H₀ is true
Example2 × P(T15 ≥ 2.3243) = 0.0346
NoteThe one-tailed p equals half the two-tailed p only when t points in the predicted direction
⑤
Confidence Interval for the Mean
CI = x̄ ± tcrit × SE  ·  CIdiff = (x̄ − μ₀) ± tcrit × SE
CIRange of plausible population means: 50.2023 to 54.6727 mm
CIdiffRange for the difference from μ₀: 0.2023 to 4.6727 mm
RuleIf μ₀ is outside the (1 − α) CI, the two-tailed test is significant
One-tailedGives a one-sided bound, for example x̄ − t1−α × SE to infinity
⑥
Effect Size: Cohen's d and Hedges' g
d = (x̄ − μ₀) ÷ s = t ÷ √n  ·  g = d × [1 − 3 ÷ (4df − 1)]
dCohen's d for a one sample t test, in SD units: 2.4375 ÷ 4.1947 = 0.5811
gHedges' g, d with a small-sample bias correction: 0.5515
d CIFrom the noncentral t distribution: 0.0413 to 1.1045
Bands0.2 small, 0.5 medium, 0.8 large (Cohen, 1992)
⑦
Power, Sample Size and Assumption Checks
Power = P(|Tdf, δ| > tcrit), δ = d√n  ·  Shapiro-Wilk W  ·  outliers beyond Q1 − 1.5·IQR or Q3 + 1.5·IQR
δNoncentrality parameter, unitless: 0.5811 × 4 = 2.32
Power0.58 for d = 0.58 at n = 16; n = 26 is needed for 80%
WShapiro-Wilk statistic, 0 to 1; p < 0.05 suggests non-normal data. Leaf data: W = 0.9789, p = 0.954
Use forDeciding whether the t test is safe, or whether the Wilcoxon signed-rank test is better

🔀 7. One Sample t Test Calculation Flowchart, Step by Step

This flowchart shows how to calculate a one sample t test, step by step, from a raw column of numbers to a decision. Every box uses the same worked example as the Excel, R and Python sections: 16 leaf lengths in mm, tested against the published species mean of 50 mm.

Start or result Data step Calculation step Yes or no check
Start One column of measurements and one test value 16 leaf lengths in mm, μ₀ = 50 mm, α = 0.05, two-tailed
1
Put every value in one column 52, 48, 55, 61, 47, 50, 58, 53, 49, 56, 51, 54, 46, 57, 50, 52
CheckIs any cell blank, text or a missing-value code?
YesDelete it. Never type 0 for a missing value, because a fake zero drags the mean down.
NoKeep all values. Here all 16 are real measurements.
2
Count the values and find df df = n − 1 n = 16, so df = 15
3
Find the sample mean x̄ = Σx ÷ n 839 ÷ 16 = 52.4375 mm
4
Find the SD and the standard error s = √[Σ(x − x̄)² ÷ (n − 1)], SE = s ÷ √n s = √(263.9375 ÷ 15) = 4.1947, SE = 4.1947 ÷ 4 = 1.0487
CheckAre the data clearly non-normal or full of outliers, with n under 30?
Yes, stopUse the Wilcoxon signed-rank test, or report it beside the t test.
NoShapiro-Wilk W = 0.9789, p = 0.954, no outliers. Carry on.
5
Divide the mean difference by SE t = (x̄ − μ₀) ÷ SE (52.4375 − 50) ÷ 1.0487 = 2.3243
6
Look up p and the critical value p = 2 × P(T15 ≥ |t|), tcrit = t0.975, 15 p = 0.0346, tcrit = 2.1314
CheckIs p below α, that is, is |t| above tcrit?
YesReject H₀. Here 0.0346 < 0.05 and 2.3243 > 2.1314.
NoDo not reject H₀. Report the CI to show what the data allow.
7
Add the interval and the effect size CI = x̄ ± tcrit × SE, d = (x̄ − μ₀) ÷ s 95% CI 50.2023 to 54.6727 mm, d = 0.5811
Result t(15) = 2.32, p = 0.035, 95% CI [50.20, 54.67], d = 0.58 Significant at α = 0.05 Medium effect Rule: reject H₀ when p < α; read d with 0.2 small, 0.5 medium, 0.8 large.

Check any box yourself: the Excel sheet in Section 9, the R script in Section 10 and the Python script in Section 11 all return t = 2.3243, df = 15 and p = 0.0346 for this dataset.

📝 8. How to Use This Calculator

  1. Enter your data. The default tab takes comma-separated numbers, exactly as the placeholder shows: 52, 48, 55, 61, 47, .... Spaces, tabs, semicolons and new lines also work, so a column pasted from Excel is fine.
  2. Name the group. The group name above each box is editable. Type something meaningful, such as Leaf length, site 2, and it appears in the tables, charts and reports.
  3. Add more groups if needed. Press Add group to test several groups against the same value. Each group gets its own test and a Holm-adjusted p-value.
  4. Or upload a file. On the Upload tab, choose a CSV or Excel file and click the columns you want. Each column you click becomes its own group.
  5. Or use summary statistics. If you only have n, the mean and the SD, open the Summary Statistics tab and type them in.
  6. Set the hypothesized mean μ₀. This is the benchmark: a norm, a label claim, a target or a published mean.
  7. Choose the alternative hypothesis and α. Use two-tailed unless you decided on a direction before collecting data.
  8. Press Run One Sample t Test. Nothing is computed until you do. Changing a setting clears old results, so you never read stale numbers.
  9. Read the results in order. Mean difference first, then the confidence interval, then t and p, then Cohen's d and the assumption checks.
  10. Copy and export. Section 5 fills five reporting templates with your numbers, and the buttons download a text report or a print-ready PDF.

📈 9. How to Run a One Sample t Test in Excel

Excel has no single function called "one sample t test", and that is what trips most people up. T.TEST only compares two ranges. You can still do a one sample t test in Excel in two ways: build it from AVERAGE, STDEV.S and T.DIST.2T, which shows every step, or use a short trick with T.TEST and a column of μ₀ values. Both give exactly the same answer as R, Python and this calculator. The screenshots below use the leaf data in A2:A17 and μ₀ = 50.

The whole thing in one cell: with your data in A2:A17 and μ₀ = 50, the two-tailed p-value is =T.DIST.2T(ABS((AVERAGE(A2:A17)-50)/(STDEV.S(A2:A17)/SQRT(COUNT(A2:A17)))),COUNT(A2:A17)-1), which returns 0.0346.

9.1 The functions you need

You wantExcel functionNote
Sample size n=COUNT(A2:A17)Counts numbers only. COUNTA would count the header too
Mean=AVERAGE(A2:A17)Ignores blank cells and text
Sample SD=STDEV.S(A2:A17)Uses n − 1. Never STDEV.P for a t test
Standard error=C4/SQRT(C2)SD divided by the square root of n
t statistic=(C3-C6)/C5Mean minus μ₀, divided by SE
Two-tailed p=T.DIST.2T(ABS(C7),C8)Needs a positive t, so wrap it in ABS
One-tailed p, greater=T.DIST.RT(C7,C8)Right tail. For "less" use =T.DIST(C7,C8,TRUE)
Critical t=T.INV.2T(0.05,C8)Two-tailed. One-tailed: =T.INV(0.95,C8)
CI half-width=CONFIDENCE.T(0.05,C4,C2)Margin of error, add and subtract from the mean
p in one step=T.TEST(A2:A17,B2:B17,2,1)Column B filled with μ₀, type 1 = paired. Same p
The T.TEST trap. T.TEST needs two ranges, and its fourth argument (type) must be 1, paired. A paired test on x and a column of 50s is mathematically the same as a one sample t test against 50. Type 2 or 3 treats the column of 50s as a second group with zero spread and gives a different, wrong p-value.

9.2 Step by step, how to do a one sample t test in Excel

1 Put your numbers in one column

Type a header in A1 and the values below it. Keep units out of the cells: "52 mm" is text and Excel will skip it without warning.

Xone-sample-t.xlsx - ExcelA2fx52A1Leaf length252348455561647750858953

The 16 leaf lengths sit in A2:A17. Only the first eight rows are shown here.

2 Count, average, SD and standard error

Put labels in column B and formulas in column C, so you can see each building block.

=COUNT(A2:A17)=AVERAGE(A2:A17)=STDEV.S(A2:A17)=C4/SQRT(C2)
Xone-sample-t.xlsx - ExcelC5fx=C4/SQRT(C2)ABC1LengthStatisticValue252n16348Mean52.4375455SD4.1947561SE1.0487647750858953

n = 16 in C2, mean 52.4375 in C3, SD 4.1947 in C4 and SE 1.0487 in C5.

3 Type μ₀, then compute t and df

Keep μ₀ in its own cell (C6) so you can change it and watch everything update.

=(C3-C6)/C5=C2-1
Xone-sample-t.xlsx - ExcelC7fx=(C3-C6)/C5ABC647mu050750t2.3243858df159531049115612511354

With μ₀ = 50 in C6, t = 2.3243 in C7 and df = 15 in C8. The sheet is scrolled to rows 6 to 13.

4 Get the p-value and the critical value

=T.DIST.2T(ABS(C7),C8)=T.INV.2T(0.05,C8)

If p in C9 is below 0.05, or |t| is above the critical value in C10, reject H₀.

Xone-sample-t.xlsx - ExcelC9fx=T.DIST.2T(ABS(C7),C8)ABC647mu050750t2.3243858df15953p (2-tail)0.03461049t crit2.1314115612511354

p = 0.0346 in C9 and tcrit = 2.1314 in C10, so the result is significant at α = 0.05.

5 Add the confidence interval and Cohen's d

=C3-C10*C5=C3+C10*C5=(C3-C6)/C4
Xone-sample-t.xlsx - ExcelC13fx=(C3-C6)/C4ABC647mu050750t2.3243858df15953p (2-tail)0.03461049t crit2.13141156CI low50.20231251CI high54.67271354Cohen's d0.5811

95% CI 50.2023 to 54.6727 in C11:C12 and Cohen's d = 0.5811 in C13. Excel has no built-in effect size function.

6 The one-cell shortcut with T.TEST

Fill column B with μ₀ for every row, then run a paired T.TEST. This is the quickest way to get the p-value, but it gives no t, CI or d.

=T.TEST(A2:A17,B2:B17,2,1)
Xone-sample-t.xlsx - ExcelC2fx=T.TEST(A2:A17,B2:B17,2,1)ABC1Lengthmu0p-value252500.034634850455505615064750750508585095350

C2 returns 0.0346, identical to the long method. The 2 means two-tailed and the 1 means paired.

9.3 The awkward cases

One-tailed p. Use =T.DIST.RT(C7,C8) when H₁ says "greater". It returns 0.0173 here. For "less", use =T.DIST(C7,C8,TRUE), which returns 0.9827 here, correctly showing no evidence for a smaller mean. Halving the two-tailed p by hand gives 0.0173 in both cases, which is wrong for the "less" direction.

Analysis ToolPak. Excel's Data Analysis ToolPak has no one-sample option, but "t-Test: Paired Two Sample for Means" with a column of μ₀ values gives the same t, df and p. Turn it on first: File → Options → Add-ins → Manage Excel Add-ins → Go → tick Analysis ToolPak. Set "Hypothesized Mean Difference" to 0.

Older Excel. Excel 2007 and earlier use TDIST(ABS(t),df,2) and TINV(0.05,df). They still work in newer versions for compatibility.

The classic mistake: =T.DIST(C7,C8,TRUE) is the left-tail cumulative probability, not a p-value. For t = 2.32 it returns 0.983, which some people misreport as p = 0.98.

9.4 Why your Excel answer might differ from R or Python

SituationWhat happensFix
Blank cells in the rangeExcel ignores them, so n is smaller than you thinkCheck that COUNT returns the n you expect
Zeros typed for missing dataCounted as real values, pulling the mean downLeave missing cells blank
Numbers stored as textSilently skipped by AVERAGE and STDEV.SLook for green triangles, then Convert to Number
STDEV.P instead of STDEV.SSD too small, t too large, p too smallAlways STDEV.S for a t test
T.TEST type 2 or 3 with a μ₀ columnWrong p-valueUse type 1, paired
Python SD differsNumPy's default np.std uses ddof = 0Use np.std(x, ddof=1); SciPy's ttest_1samp is already correct
R and Python agree but SPSS differsSPSS shows p as .035 rounded, or used a different variableCompare t and df first; they should match to 3 decimals

For a one sample t test, Excel, R's t.test, SciPy's ttest_1samp and this calculator all use the same Student formula with df = n − 1, so there is no Welch versus Student disagreement as there is with two-sample tests. All four return t = 2.3243, df = 15, p = 0.0346 for the leaf data.

9.5 Charting the result in Excel

  1. Put the label "Leaf length" in E2 and the mean (=C3) in F2.
  2. Select E2:F2 and choose Insert → Column chart → Clustered Column.
  3. Click the chart, press +, tick Error Bars → More Options → Custom → Specify Value, and point both directions at a cell holding the CI half-width, =C10*C5.
  4. Add μ₀ as a horizontal line: right-click → Select Data → Add a series holding 50, then Change Chart Type → Combo → Line.
  5. Label the caption "Error bar = 95% confidence interval". Without that label, readers assume it is the SD.

Chart 1 in Section 3 draws the raw points, the mean with its CI and the μ₀ line automatically, which is usually the better figure for a paper.

9.6 Excel errors you will probably hit

Excel showsWhyFix
#DIV/0!Fewer than two numbers in the range, so the SD cannot be computedCheck the range and that the cells hold numbers, not text
#NUM! from T.DIST.2Tt is negativeWrap it: T.DIST.2T(ABS(C7),C8)
#NUM! from T.INV.2TProbability outside 0 to 1, or df below 1Use 0.05, not 5, and check n is at least 2
#N/A from T.TESTThe two ranges have different lengthsMake the μ₀ column exactly as long as the data
#VALUE!Text such as "mm" or "n/a" inside a formula rangeMove units to the header and clear text cells
p looks like 0.98T.DIST with TRUE gives the left-tail area, not a p-valueUse T.DIST.2T or T.DIST.RT

📈 10. How to Run a One Sample t Test in R

A one sample t test in R is one line: t.test(x, mu = 50). But that line gives no effect size and no assumption check, and reviewers ask for both. The script below is a complete one sample t test in R: it runs the test, adds Cohen's d, Hedges' g, a Shapiro-Wilk test and a Wilcoxon cross-check, prints a plain-English verdict and saves one 300 dpi figure. It uses base R only, so there is nothing to install.

Copy the whole block. It runs top to bottom in RStudio, VS Code or plain Rscript. Change only the x <- c(...) line and mu0 to use your own data.
statst.test, shapiro.test, wilcox.test, ships with R
graphics / grDevicesthe figure and png(), ships with R

10.1 The complete script

R, base only, saves one_sample_t_test.png

# ============================================================
# One sample t test with one publication-ready figure
# StatsUnlock - https://statsunlock.com/one-sample-t-test-calculator/
# Base R only. No packages to install.
# ============================================================

# ---- 1. Your data and settings -----------------------------
# Replace with your own values, or read a CSV:
#   x <- read.csv("data.csv")$leaf_length
x <- c(52, 48, 55, 61, 47, 50, 58, 53,
       49, 56, 51, 54, 46, 57, 50, 52)
x <- x[!is.na(x)]          # drop missing values

mu0         <- 50           # hypothesized mean
alpha       <- 0.05
alternative <- "two.sided"  # or "greater" / "less"
label       <- "Leaf length"
units       <- "mm"

# ---- 2. The test -------------------------------------------
n  <- length(x)
m  <- mean(x)
s  <- sd(x)                 # sample SD, n - 1 denominator
se <- s / sqrt(n)

res <- t.test(x, mu = mu0, alternative = alternative,
              conf.level = 1 - alpha)

t_stat <- unname(res$statistic)
df     <- unname(res$parameter)
p      <- res$p.value
ci     <- res$conf.int

# ---- 3. Effect size and assumption checks ------------------
d  <- (m - mu0) / s                      # Cohen's d
g  <- d * (1 - 3 / (4 * df - 1))         # Hedges' g
sw <- shapiro.test(x)                    # normality
wx <- suppressWarnings(wilcox.test(x, mu = mu0, exact = FALSE,
                                   correct = TRUE))

size <- ifelse(abs(d) < 0.2, "negligible",
        ifelse(abs(d) < 0.5, "small",
        ifelse(abs(d) < 0.8, "medium", "large")))

# ---- 4. Printed summary ------------------------------------
cat(sprintf("One sample t test: %s vs mu0 = %g %s\n", label, mu0, units))
cat(sprintf("n = %d, mean = %.4f, SD = %.4f, SE = %.4f\n", n, m, s, se))
cat(sprintf("t(%d) = %.4f, p = %.4f\n", df, t_stat, p))
cat(sprintf("%g%% CI for the mean: %.4f to %.4f\n",
            100 * (1 - alpha), ci[1], ci[2]))
cat(sprintf("Cohen's d = %.4f, Hedges' g = %.4f (%s)\n", d, g, size))
cat(sprintf("Shapiro-Wilk W = %.4f, p = %.4f\n",
            sw$statistic, sw$p.value))
cat(sprintf("Wilcoxon signed-rank check: p = %.4f\n", wx$p.value))

if (p < alpha) {
  cat(sprintf("Verdict: p is below %g, so the mean differs from %g. The effect is %s (d = %.2f).\n",
              alpha, mu0, size, d))
} else {
  cat(sprintf("Verdict: p is not below %g, so there is no clear evidence the mean differs from %g.\n",
              alpha, mu0))
}

# ---- 5. One figure, 300 dpi --------------------------------
set.seed(42)
png("one_sample_t_test.png", width = 2400, height = 1200, res = 300)
par(mfrow = c(1, 2), mar = c(4, 4.2, 2.5, 1))

jit <- runif(n, 0.75, 1.25)
plot(jit, x, xlim = c(0.4, 1.8), xaxt = "n", pch = 19,
     col = "#2563eb", xlab = "", ylab = paste0(label, " (", units, ")"),
     main = "Data, mean and mu0", ylim = range(c(x, mu0, ci)))
abline(h = mu0, lty = 2, col = "#c2410c", lwd = 2)
segments(1.5, ci[1], 1.5, ci[2], col = "#16a34a", lwd = 3)
points(1.5, m, pch = 18, cex = 2, col = "#16a34a")
legend("topleft", bty = "n", cex = 0.7,
       legend = c("mean with CI", "mu0"),
       col = c("#16a34a", "#c2410c"), lty = c(1, 2), lwd = 2)

qqnorm(x, main = "Normal Q-Q plot", pch = 19, col = "#9333ea")
qqline(x, col = "#0d9488", lwd = 2)
invisible(dev.off())
cat("Figure saved: one_sample_t_test.png\n")

Output for the leaf data: n = 16, mean = 52.4375, SD = 4.1947, t(15) = 2.3243, p = 0.0346, 95% CI 50.2023 to 54.6727, d = 0.5811, g = 0.5515, Shapiro-Wilk W = 0.9789, p = 0.9541.

10.2 What each part does

Line or functionWhat it does and why it is there
x[!is.na(x)]Drops missing values. Without it, mean() and sd() return NA.
sd(x)Sample SD with n − 1, the same as Excel's STDEV.S.
t.test(x, mu = mu0)The one sample t test. mu is μ₀; the default is 0, so forgetting it tests against zero.
alternative"two.sided", "greater" or "less". One-sided tests also return a one-sided CI with an Inf bound.
conf.levelSet to 1 − α so the CI matches your significance level.
res$statistic, res$parametert and df. unname() removes the labels so sprintf prints clean numbers.
d and gCohen's d and Hedges' g. Base R has no effect-size function, so they are computed directly.
shapiro.test(x)Normality test. Works for 3 to 5,000 values.
wilcox.test(x, mu = mu0)Non-parametric cross-check. exact = FALSE, correct = TRUE matches this calculator.
png(..., res = 300)Opens a 300 dpi file. dev.off() closes and saves it.
set.seed(42)Fixes the jitter so the figure is identical every run.

10.3 What the figure shows

The left panel shows each leaf as a blue point, the mean as a green diamond with its 95% CI, and μ₀ = 50 mm as a dashed orange line. The green interval sits entirely above the dashed line, which is the picture of a significant two-tailed result. The right panel is a normal Q-Q plot. The points lie close to the line, so normality is reasonable.

10.4 Common R problems and fixes

ProblemCauseFix
t is much larger than expectedForgot mu =, so R tested against 0Always write mu = 50
Result is NAMissing values in xAdd x <- x[!is.na(x)]
"not enough 'x' observations"Fewer than 2 valuesCheck how the column was read
Error: argument is not numericThe CSV column was read as textUse as.numeric() and check for commas or units
CI has an Inf boundA one-sided test was runExpected. Use "two.sided" for a two-sided interval
wilcox.test warns about tiesRepeated valuesUse exact = FALSE as in the script
Figure is blankdev.off() was not reachedRun the whole script, not just part of it

10.5 Useful one-liners

TaskR code
Basic testt.test(x, mu = 50)
One-tailed, greatert.test(x, mu = 50, alternative = "greater")
99% CIt.test(x, mu = 50, conf.level = 0.99)$conf.int
Formula interfacet.test(leaf ~ 1, data = df, mu = 50)
One test per groupby(df$leaf, df$site, t.test, mu = 50)
Cohen's d with CI (package)effectsize::cohens_d(x, mu = 50)
Sample size for 80% powerpower.t.test(delta = 2.5, sd = 4.2, power = 0.8, type = "one.sample")

📈 11. How to Run a One Sample t Test in Python

In Python the one sample t test is scipy.stats.ttest_1samp(x, popmean=50). The script below adds what SciPy leaves out: Cohen's d, Hedges' g, a Shapiro-Wilk check, a Wilcoxon cross-check, a plain-English verdict and one 300 dpi figure. It prints exactly the same numbers as the R script and this calculator.

Copy the whole block. It needs NumPy, SciPy 1.10 or newer, and Matplotlib. Change only the x = np.array([...]) line and mu0.
numpyarrays, mean and SD
scipy.statsttest_1samp, shapiro, wilcoxon
matplotlibthe figure

Install with pip install numpy scipy matplotlib if you do not already have them.

11.1 The complete script

Python 3, saves one_sample_t_test.png

# ============================================================
# One sample t test with one publication-ready figure
# StatsUnlock - https://statsunlock.com/one-sample-t-test-calculator/
# ============================================================
import numpy as np
from scipy import stats
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt

# ---- 1. Your data and settings -----------------------------
# Replace with your own values, or read a CSV:
#   import pandas as pd
#   x = pd.read_csv("data.csv")["leaf_length"].to_numpy(dtype=float)
x = np.array([52, 48, 55, 61, 47, 50, 58, 53,
              49, 56, 51, 54, 46, 57, 50, 52], dtype=float)
x = x[~np.isnan(x)]              # drop missing values

mu0 = 50                         # hypothesized mean
alpha = 0.05
alternative = "two-sided"        # or "greater" / "less"
label, units = "Leaf length", "mm"

# ---- 2. The test -------------------------------------------
n = len(x)
m = x.mean()
s = x.std(ddof=1)                # sample SD, matches Excel STDEV.S
se = s / np.sqrt(n)

res = stats.ttest_1samp(x, popmean=mu0, alternative=alternative)
t_stat, p = res.statistic, res.pvalue
df = n - 1
ci = res.confidence_interval(confidence_level=1 - alpha)

# ---- 3. Effect size and assumption checks ------------------
d = (m - mu0) / s                        # Cohen's d
g = d * (1 - 3 / (4 * df - 1))           # Hedges' g
sw = stats.shapiro(x)                    # normality
wx = stats.wilcoxon(np.round(x - mu0, 10), method="approx", correction=True)

if abs(d) < 0.2:
    size = "negligible"
elif abs(d) < 0.5:
    size = "small"
elif abs(d) < 0.8:
    size = "medium"
else:
    size = "large"

# ---- 4. Printed summary ------------------------------------
print(f"One sample t test: {label} vs mu0 = {mu0} {units}")
print(f"n = {n}, mean = {m:.4f}, SD = {s:.4f}, SE = {se:.4f}")
print(f"t({df}) = {t_stat:.4f}, p = {p:.4f}")
print(f"{100 * (1 - alpha):g}% CI for the mean: {ci.low:.4f} to {ci.high:.4f}")
print(f"Cohen's d = {d:.4f}, Hedges' g = {g:.4f} ({size})")
print(f"Shapiro-Wilk W = {sw.statistic:.4f}, p = {sw.pvalue:.4f}")
print(f"Wilcoxon signed-rank check: p = {wx.pvalue:.4f}")
if p < alpha:
    print(f"Verdict: p is below {alpha}, so the mean differs from {mu0}. "
          f"The effect is {size} (d = {d:.2f}).")
else:
    print(f"Verdict: p is not below {alpha}, so there is no clear evidence "
          f"the mean differs from {mu0}.")

# ---- 5. One figure, 300 dpi --------------------------------
rng = np.random.default_rng(42)
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4))

jit = rng.uniform(0.75, 1.25, n)
ax1.scatter(jit, x, color="#2563eb", zorder=3)
ax1.axhline(mu0, ls="--", color="#c2410c", lw=2, label="mu0")
ax1.errorbar(1.5, m, yerr=[[m - ci.low], [ci.high - m]], fmt="D",
             color="#16a34a", capsize=6, lw=3, label="mean with CI")
ax1.set_xlim(0.4, 1.8)
ax1.set_xticks([])
ax1.set_ylabel(f"{label} ({units})")
ax1.set_title("Data, mean and mu0")
ax1.legend(frameon=False, fontsize=8)

stats.probplot(x, dist="norm", plot=ax2)
ax2.get_lines()[0].set_color("#9333ea")
ax2.get_lines()[1].set_color("#0d9488")
ax2.set_title("Normal Q-Q plot")

fig.tight_layout()
fig.savefig("one_sample_t_test.png", dpi=300, bbox_inches="tight")
print("Figure saved: one_sample_t_test.png")

Output for the leaf data, checked: t(15) = 2.3243, p = 0.0346, 95% CI 50.2023 to 54.6727, d = 0.5811, g = 0.5515, Shapiro-Wilk W = 0.9789, p = 0.9541, Wilcoxon p = 0.0476.

11.2 What each part does

Line or functionWhat it does and why it is there
dtype=floatAvoids integer surprises and lets np.isnan work.
x[~np.isnan(x)]Drops missing values. np.mean returns nan if any value is nan.
x.std(ddof=1)Sample SD. Without ddof=1 NumPy uses n and the SD is too small.
stats.ttest_1sampThe one sample t test. popmean is μ₀.
alternative="two-sided", "greater" or "less". Computed directly, so never halve p yourself.
res.confidence_interval()CI for the mean. Needs SciPy 1.10 or newer.
stats.shapiroNormality test, same algorithm as R.
np.round(x - mu0, 10)Removes floating-point noise so tied differences are ranked as ties.
stats.wilcoxon(..., method="approx", correction=True)Normal approximation with continuity correction, matching R and this calculator.
default_rng(42)Seeded jitter, so the figure is reproducible.
savefig(dpi=300)Publication resolution. bbox_inches="tight" trims white space.

11.3 What the figure shows

The same two panels as the R figure: the raw values with the mean and its 95% CI against the dashed μ₀ line, and a normal Q-Q plot. Because both scripts seed their jitter, re-running gives an identical picture.

11.4 Common Python problems and fixes

ProblemCauseFix
AttributeError: confidence_intervalSciPy older than 1.10pip install -U scipy, or compute m ± t.ppf(0.975, df) * se
p is nannan values in the arrayUse nan_policy="omit" or drop them first
d differs from Rnp.std without ddof=1Use ddof=1
Wilcoxon p differs from RExact versus approximate method, or float tiesUse method="approx", correction=True and round the differences
TypeError with pandas columnColumn read as stringspd.to_numeric(df["col"], errors="coerce")
No figure appearsThe Agg backend writes files onlyOpen the PNG, or use plt.show() in Jupyter

11.5 Useful one-liners

TaskPython code
Basic teststats.ttest_1samp(x, 50)
One-tailed, lessstats.ttest_1samp(x, 50, alternative="less")
Ignore missing valuesstats.ttest_1samp(x, 50, nan_policy="omit")
Critical tstats.t.ppf(0.975, df=len(x) - 1)
From summary statisticst = (m - 50) / (s / n ** 0.5); p = 2 * stats.t.sf(abs(t), n - 1)
One test per groupdf.groupby("site")["ph"].apply(lambda v: stats.ttest_1samp(v, 7).pvalue)
Sample size (statsmodels)TTestPower().solve_power(effect_size=0.5, power=0.8, alpha=0.05)
R and Python agree exactly. Both scripts use the sample SD, the same Student t distribution with df = n − 1, the same Shapiro-Wilk algorithm and the same Wilcoxon settings. Run them on the leaf data and both print t = 2.3243 and p = 0.0346. To run the Python script, save it as one_sample_t.py and type python one_sample_t.py, or in Jupyter drop the savefig line and add plt.show().

📋 12. Reference Tables

12.1 Critical values of t for a one sample t test

dfOne-tailed 0.05 / two-tailed 0.10One-tailed 0.025 / two-tailed 0.05One-tailed 0.01 / two-tailed 0.02One-tailed 0.005 / two-tailed 0.01One-tailed 0.0005 / two-tailed 0.001
16.31412.70631.82163.657636.619
22.9204.3036.9659.92531.599
32.3533.1824.5415.84112.924
42.1322.7763.7474.6048.610
52.0152.5713.3654.0326.869
61.9432.4473.1433.7075.959
71.8952.3652.9983.4995.408
81.8602.3062.8963.3555.041
91.8332.2622.8213.2504.781
101.8122.2282.7643.1694.587
121.7822.1792.6813.0554.318
151.7532.1312.6022.9474.073
201.7252.0862.5282.8453.850
251.7082.0602.4852.7873.725
301.6972.0422.4572.7503.646
401.6842.0212.4232.7043.551
601.6712.0002.3902.6603.460
1201.6581.9802.3582.6173.373
∞ (z)1.6451.9602.3262.5763.291

What to conclude: if |t| is larger than the value in your df row and α column, reject H₀. For df = 15 and a two-tailed α = 0.05 the cut-off is 2.131, so the leaf example (t = 2.324) is significant. When your df is missing, use the next smaller df, which is the conservative choice. Values computed from the t distribution (Student, 1908).

12.2 Cohen's d for a one sample t test: interpretation bands

|d|LabelWhat it looks likeVerdict
below 0.20NegligibleThe mean is within a fifth of an SD of μ₀Trivial
0.20 to 0.49SmallReal but hard to see without careful measurementSmall
0.50 to 0.79MediumVisible to a careful observerMedium
0.80 and aboveLargeObvious in a plot of the raw dataLarge

What to conclude: these are Cohen's (1992) general guides, not rules. Judge the size against what matters in your field, and always report the difference in real units too (Lakens, 2013; Sullivan & Feinn, 2012).

12.3 Sample size needed for a one sample t test

True effect dn for 80% power, α = 0.05n for 90% power, α = 0.05n for 80% power, α = 0.01
0.2 (small)199265296
0.390119134
0.5 (medium)344451
0.8 (large)151922
1.0101316
1.281012

What to conclude: halving the effect you want to detect roughly quadruples the n you need. Values are exact, computed from the noncentral t distribution for a two-tailed test, and agree with G*Power (Faul et al., 2007).

12.4 Power of a one sample t test at common sample sizes

nd = 0.2d = 0.5d = 0.8
100.0880.2930.616
200.1360.5650.924
300.1850.7540.988
500.2840.934above 0.999
1000.5080.999above 0.999

What to conclude: with n = 10 you will miss a medium effect about 7 times in 10. A non-significant result from a small sample is weak evidence that there is no effect (two-tailed, α = 0.05).

12.5 How much normality matters at each sample size

nNormality needed?What to do
below 15Yes, closelyUse the t test only if the data look symmetric with no outliers. Otherwise use the Wilcoxon signed-rank test
15 to 39ModeratelyFine unless there are outliers or strong skew. Check chart 3 and chart 4
40 or moreLittleThe t test is robust to skew, but outliers can still move the mean
Very large nHardly at allShapiro-Wilk will flag tiny departures that do not matter; judge the plots, not the p

What to conclude: the larger the sample, the less the shape of the raw data matters for the mean, but outliers matter at every n (Lumley et al., 2002; Ghasemi & Zahediasl, 2012).

12.6 Which one-sample test should you use?

Your situationUseStatsUnlock tool
Continuous, roughly normal, σ unknownOne sample t testThis page
Continuous, σ truly knownOne sample z testOne Sample Z Test Calculator
Skewed, outliers, or ordinal ratingsWilcoxon signed-rank testWilcoxon Signed Rank Test Calculator
Very skewed or only direction mattersSign testSign Test Calculator
Before and after on the same unitsPaired t testPaired Samples t Test Calculator
A proportion against a valueOne proportion z testOne Proportion Z Test Calculator

What to conclude: the one sample t test is the default for a mean, but it is not the only option. Match the test to the data type and its shape.

12.7 How to describe a p-value in words

p-valuePlain wordingVerdict at α = 0.05
below 0.001Very strong evidence against H₀Significant
0.001 to 0.01Strong evidence against H₀Significant
0.01 to 0.05Moderate evidence against H₀Significant
0.05 to 0.10Weak evidence, inconclusiveNot significant
0.10 and aboveLittle or no evidence against H₀Not significant

What to conclude: these words describe evidence, not truth. Several statisticians have argued for α = 0.005 for new discoveries (Benjamin et al., 2018). Whatever you pick, pick it before the analysis.

📈 13. Example Results

Eight one sample t test examples, each with the full numbers, a figure, what it means and how to write it. Load the matching sample dataset in Section 2 to reproduce any of them.

1
TEXTBOOK CASE

Leaf length against a published species mean

The clean worked example used all through this page.

A botany class measured 16 leaves and asked whether they differ from the published mean of 50 mm.

n = 16M = 52.44 mmt(15) = 2.32p = 0.035d = 0.58
StatisticValueNote
Mean (SD)52.4375 (4.1947)mm
μ₀50Published mean
Mean difference2.437595% CI 0.2023 to 4.6727
t(df)2.3243 (15)Critical t = 2.1314
p, two-tailed0.0346Below 0.05
Cohen's d0.5811Medium, 95% CI 0.04 to 1.10
Shapiro-Wilk p0.954Normality is fine
45505560mmμ₀ = 50mean 52.44, 95% CI
The 95% CI for the mean (green bar) lies wholly above the dashed 50 mm line.

What it means: The leaves are 2.44 mm longer on average than the published value. The CI for the difference runs from 0.20 to 4.67 mm, so the true gap could be tiny or close to 5 mm. The effect is medium, and the d interval is wide because n is only 16.

How to write it: "Leaf length (M = 52.44 mm, SD = 4.19) was greater than the published mean of 50 mm, t(15) = 2.32, p = .035, 95% CI [50.20, 54.67], d = 0.58."

2
CLEARLY SIGNIFICANT

Blood pressure on a high-salt diet

A large effect that no reader could miss.

20 adults on a high-salt diet had systolic pressure measured and compared with the 120 mmHg reference.

n = 20M = 129.55t(19) = 8.44p < .001d = 1.89
StatisticValueNote
Mean (SD)129.55 (5.06)mmHg
Mean difference9.5595% CI 7.18 to 11.92
t(df)8.4363 (19)Critical t = 2.0930
p, two-tailedbelow 0.0001Very strong evidence
Cohen's d1.8864Large
120125130135mmHgμ₀ = 120mean 129.55, 95% CI
Every single reading is above 120 mmHg, and the CI is far from the reference line.

What it means: The group averages almost 10 mmHg above the reference, and even the lower CI limit is 7 mmHg above it. With d near 1.9, this is a large difference with clinical weight, not just a statistical one.

How to write it: "Systolic pressure (M = 129.55 mmHg, SD = 5.06) exceeded 120 mmHg, t(19) = 8.44, p < .001, 95% CI [127.18, 131.92], d = 1.89."

3
BORDERLINE

Customer satisfaction on a 1 to 7 scale

p lands just under 0.05.

40 customers rated a new service. The question: is the average rating above the neutral midpoint of 4?

n = 40M = 4.28t(39) = 2.05p = 0.047d = 0.32
StatisticValueNote
Mean (SD)4.275 (0.847)scale points, median 4
Mean difference0.27595% CI 0.004 to 0.546
t(df)2.0536 (39)Critical t = 2.0227
p, two-tailed0.0468Just below 0.05
Cohen's d0.3247Small
Wilcoxon p0.0465Agrees with the t test
3456scale pointsμ₀ = 4mean 4.28, 95% CI
The lower end of the CI almost touches the midpoint of 4.

What it means: The rating is slightly above neutral, but the lower CI limit is only 0.004 points above 4. A few different answers would push p over 0.05. Shapiro-Wilk flags non-normality, which is normal for a 7-point scale; the Wilcoxon test agrees, so the conclusion holds, but it is weak.

How to write it: "Satisfaction (M = 4.28, SD = 0.85) was slightly above the scale midpoint, t(39) = 2.05, p = .047, d = 0.32, a small effect; a Wilcoxon signed-rank test gave the same conclusion (p = .047)."

4
NULL RESULT

Cereal box fill weight against the label

A well-run process, where "not significant" is the good news.

A quality check weighed 30 boxes against the 500 g label claim.

n = 30M = 499.91 gt(29) = −0.36p = 0.725d = −0.06
StatisticValueNote
Mean (SD)499.913 (1.335)g
95% CI for the mean499.415 to 500.412Contains 500
t(df)−0.3555 (29)Far inside ±2.045
p, two-tailed0.7248No evidence of a shift
Cohen's d−0.0649Negligible
498500502gμ₀ = 500mean 499.91, 95% CI
The CI straddles the 500 g line and is less than 1 g wide.

What it means: There is no evidence the line is under- or over-filling. Better still, the CI is narrow: the true mean is very likely within half a gram of 500 g. A narrow CI around μ₀ is good evidence of no meaningful difference. A formal equivalence test (TOST) would make that claim official.

How to write it: "Mean fill weight (M = 499.91 g, SD = 1.34) did not differ from the 500 g label, t(29) = −0.36, p = .725, 95% CI [499.41, 500.41]."

5
SMALL SAMPLE

VO2 max in six club runners

A large effect that is not significant, because n is tiny.

Six runners were tested against a population norm of 50 ml/kg/min.

n = 6M = 54.57t(5) = 2.14p = 0.086d = 0.87
StatisticValueNote
Mean (SD)54.567 (5.237)ml/kg/min
95% CI for the mean49.071 to 60.063Wide, includes 50
t(df)2.1359 (5)Critical t = 2.5706
p, two-tailed0.0858Not significant
Cohen's d0.8720Large, Hedges' g = 0.73
n for 80% power13For d = 0.87
505560ml/kg/minμ₀ = 50mean 54.57, 95% CI
With only six points, the CI stretches from just below 50 to about 60.

What it means: The runners may well be fitter than the norm: d is large. But with df = 5 the critical t is 2.57, so the test cannot rule out chance. "Not significant" here means "not enough data", not "no difference". About 13 runners would give 80% power for an effect this size.

How to write it: "VO2 max (M = 54.57, SD = 5.24, n = 6) did not differ significantly from 50 ml/kg/min, t(5) = 2.14, p = .086, although the effect was large (d = 0.87, g = 0.73), suggesting the study was underpowered."

6
SIGNIFICANT BUT TRIVIAL

2,500 test scores against a norm of 100

A big sample makes a tiny difference significant.

A district reports a mean of 100.75 (SD 15) for 2,500 pupils on a test normed at 100. Entered on the Summary Statistics tab.

n = 2500M = 100.75t(2499) = 2.50p = 0.012d = 0.05
StatisticValueNote
Mean (SD)100.75 (15.00)score points
SE0.3015 ÷ 50
95% CI for the mean100.16 to 101.34Narrow
t(df)2.5000 (2499)Critical t = 1.9609
p, two-tailed0.0125Significant
Cohen's d0.0500Negligible
100100.5101score pointsμ₀ = 100Summary statistics only, n = 2500: no raw points to plotmean 100.75, 95% CI
The CI excludes 100, but the whole interval is within about 1.3 points of it.

What it means: The difference is statistically real and practically meaningless: three quarters of a point on a scale with SD 15. Headlines saying "pupils score significantly above the national norm" would be technically true and badly misleading. Lead with the effect size.

How to write it: "Scores were marginally above the norm (M = 100.75, SD = 15.00), t(2499) = 2.50, p = .012, but the effect was negligible (d = 0.05)."

7
ASSUMPTION FAILURE

Hospital length of stay against a 5-day target

Two outliers hide a real difference.

20 patients' stays in days. Most went home in 2 to 4 days, but two stayed 18 and 21 days.

n = 20M = 4.55median = 3t test p = 0.703Wilcoxon p = 0.018
StatisticValueNote
Mean (SD)4.55 (5.21)days, inflated by 2 outliers
t(df)−0.3866 (19)p = 0.7034
Shapiro-WilkW = 0.499, p < .001Strongly non-normal
Skewness2.79Heavy right skew
Wilcoxon signed-rankp = 0.0182Median is below 5
5101520daysμ₀ = 5mean 4.55, 95% CI
Two extreme stays drag the mean and stretch the CI across the 5-day line.

What it means: The t test says "no difference", but that is the outliers talking. The two long stays inflate both the mean and the SD, so t is small. The typical patient leaves after 3 days, well under target, and the Wilcoxon test detects this. This is the case where the assumption checks change the conclusion.

How to write it: "Length of stay was strongly right-skewed (Shapiro-Wilk W = 0.50, p < .001), so a Wilcoxon signed-rank test was used: the median stay of 3 days was below the 5-day target (p = .018)."

8
APPLIED FIELD STUDY

Stream pH below a mill outfall

Three sites, one test value, and a multiple-testing correction.

12 pH readings at each of three stream sites, each tested against neutral pH 7.0. Load sample dataset 6 to see all three groups.

3 groupsSite B M = 6.70t(11) = −8.35Holm p < .001d = −2.41
SiteMean (SD)t(11)pHolm pd
A upstream7.045 (0.095)1.6360.13020.13020.47
B mill outfall6.697 (0.126)−8.353below 0.0001below 0.0001−2.41
C downstream6.912 (0.106)−2.8970.01450.0291−0.84
6.66.87pH unitsμ₀ = 7.0Site A upstreamSite B mill outfallSite C downstream
Site B sits clearly below neutral; Site C is slightly acidic; Site A is consistent with 7.0.

What it means: Water below the outfall is clearly acidic, about 0.3 pH units below neutral, and the effect fades downstream. Site C stays significant after the Holm correction. Note that these tests compare each site with 7.0, not the sites with each other; for that you need a one-way ANOVA.

How to write it: "pH at the outfall (M = 6.70, SD = 0.13) was below neutral, t(11) = −8.35, Holm-adjusted p < .001, d = −2.41; downstream pH was also lower (M = 6.91, pHolm = .029)."

🧪 14. Data Collection Protocol

Study design: a one sample t test assumes a single random sample of independent units, each measured once on an interval or ratio scale, compared with a test value μ₀ that was fixed before the data were seen.

  1. Fix μ₀ for your one sample t test before collecting data. Write down the value and its source: a regulation, a label, a published mean or a design target. A μ₀ chosen after seeing the data is not a test.
  2. Decide the alternative hypothesis in advance. Two-tailed is the default. Use one-tailed only if a difference in the other direction would be impossible or would not change any decision.
  3. Plan the sample size for the one sample t test. Decide the smallest difference that matters, convert it to d, and read the n from Table 12.3. For d = 0.5 at 80% power you need 34 units.
  4. Define the unit of observation. One leaf, one patient, one box. Repeated readings on the same unit are not independent; average them first.
  5. Sample at random from the population you want to describe. A convenience sample answers a question about a different population.
  6. Fix the instrument, units and precision. Calibrate once, record the method, and do not switch instruments partway through.
  7. Record missing values as blanks, never zeros.
  8. Write the outlier rule before you look. For example: "values beyond 3 SD will be checked against field notes and kept unless a recording error is found."
  9. State the fallback test. If normality clearly fails in a small sample, you will report the Wilcoxon signed-rank test.
  10. Enter data in one column per group, exactly as the layout below shows, ready to paste or upload.
Leaf length (mm)Site 2 (mm)Site 3 (mm)
524955
485153
554758

One column per group, one row per unit, numbers only below the header row. Unequal group sizes are fine.

Minimum sample: the test runs with n = 2, but below about 10 it has little power and the normality assumption cannot be checked. Aim for at least 15, and use Table 12.3 for a real target.

Pre-registration: record μ₀ and its source, the tail, α, the planned n, the outlier rule and the fallback test before collecting data.

Common collection mistakes:

  • Choosing μ₀ or the tail after seeing the mean.
  • Counting repeat measurements of one unit as separate observations.
  • Recording missing data as 0.
  • Stopping data collection as soon as p drops below 0.05.
  • Mixing units, for example some values in cm and some in mm.

🎯 15. When to Use a One Sample t Test

This free one sample t test calculator is designed for one question: does the mean of one group differ from one fixed value?

Use it when:

  • ✓ You have one sample of a continuous measurement.
  • ✓ You have a single benchmark value μ₀ that does not come from the same data.
  • ✓ The population standard deviation is unknown, which is almost always the case.
  • ✓ The observations are independent of each other.
  • ✓ The data are roughly symmetric, or n is 30 or more without heavy outliers.

Do not use it when:

  • ✗ You want to compare two groups with each other. Use an independent samples t test.
  • ✗ You measured the same units twice. Use a paired t test (a one sample t test on the differences).
  • ✗ The data are strongly skewed or ordinal with a small n. Use the Wilcoxon signed-rank test.
  • ✗ The outcome is a yes/no proportion. Use a one proportion z test.
  • ✗ You know the true population σ. Use a one sample z test.
  • ✗ You want to show the mean is close to μ₀. Use an equivalence test (TOST).

15.1 Four real-world examples

  • Quality control: do bottles contain the 750 ml on the label?
  • Medicine: is mean fasting glucose in a clinic above the 100 mg/dL reference?
  • Education: does a school's mean score differ from the national average of 70?
  • Ecology: does mean stream pH below a mill differ from neutral 7.0?

15.2 Decision tree

QuestionIf yesIf no
1. Is there one group and one fixed value?Go to 2Two groups: independent or paired t test. Three or more: ANOVA
2. Is the outcome a measurement, not a count of yes/no?Go to 3One proportion z test
3. Is the population σ known?One sample z testGo to 4
4. Roughly normal, or n ≥ 30 with no extreme outliers?One sample t testWilcoxon signed-rank test, or the sign test

🔧 16. Troubleshooting and Common Errors

"Need at least 2 numeric values" message

Cause: the box holds one number, or the values contain text, units or a thousands separator. Fix: remove units and letters, use a full stop as the decimal point, and press Run again. The count n is shown on every group.

t is huge and p is essentially 0

Cause: μ₀ is still the default from a sample dataset, or set to 0. Fix: type the correct test value in the μ₀ box.

"Standard deviation is zero" message

Cause: every value is identical, so there is no spread and t is undefined. Fix: check the data were pasted correctly. Rounded data with no variation cannot be tested.

My result differs from Excel

Cause: STDEV.P instead of STDEV.S, T.TEST with type 2 or 3, or blank cells changing n. Fix: compare n first, then the SD, then t. Section 9.4 lists every cause.

The one-tailed p is close to 1

Cause: the mean is on the other side of μ₀ from the direction you predicted. Fix: this is correct. A one-tailed test cannot find a difference in the direction you did not test.

Shapiro-Wilk says my data are not normal

Cause: real skew or outliers, or a rating scale with few possible values, or a very large n where trivial departures are flagged. Fix: look at chart 3 and chart 4. Compare the t test with the Wilcoxon result in the assumption table. If they agree, the conclusion is safe.

The t test and the Wilcoxon test disagree

Cause: outliers or skew make the mean behave differently from the median. Fix: decide which question matters, mean or median, and report the test that answers it. Example 7 shows this case.

Uploaded file shows no column buttons

Cause: the columns contain text, or the header is not in row 1. Fix: keep one header row and numbers below it. Only columns with numbers get a button.

Charts 1, 3 and 4 are empty

Cause: you ran the test from the Summary Statistics tab, which has no raw values. Fix: this is expected. Chart 2, the t distribution, still works.

Charts do not appear at all

Cause: the Chart.js library was blocked by a browser extension or network filter. Fix: allow cdnjs.cloudflare.com and reload. All numbers and tables still work without the charts.

The PDF prints blank pages

Cause: the print dialog opened before the report was built, or "background graphics" is off. Fix: press Run first, then Download PDF, and choose "Save as PDF" in the dialog.

⚖ 17. Assumptions and Limitations

Assumptions of a one sample t test

  1. Independence. Each observation is a separate unit, not influenced by the others. Check: the study design; there is no statistical test that fixes this. If it fails: clustered or repeated data make the SE too small, so p is too small and false positives rise.
  2. Continuous outcome. The variable is measured on an interval or ratio scale. Check: what the numbers mean. If it fails: with ordinal ratings the mean may not be meaningful; results can be misleading in either direction.
  3. Approximate normality. The population is roughly normal, or n is large enough for the mean to be. Check: Shapiro-Wilk, skewness, chart 3 and chart 4. If it fails: with skew in small samples, one-tailed p-values can be too small in one tail and too large in the other.
  4. No extreme outliers. Check: the outlier row in the assumption table and chart 1. If it fails: outliers inflate the SD, so t shrinks and real differences are missed, as in Example 7.
  5. Random sampling. The sample represents the population of interest. Check: how units were selected. If it fails: the result is biased in an unknown direction, and no statistic can show it.
  6. A fixed, pre-specified μ₀. Check: that the value came from outside the data. If it fails: choosing μ₀ after seeing the data biases p downwards.

Limitations

  • It tests the mean only. For the median, use the Wilcoxon signed-rank test or the sign test.
  • A non-significant result does not prove the mean equals μ₀. To show closeness, use an equivalence test (TOST; Lakens, 2017).
  • It handles one group against a value. To compare groups with each other, use an independent samples t test or ANOVA.
  • It assumes a simple random sample. Survey designs with weights or clusters need design-based methods.
  • Testing many groups inflates false positives. Use the Holm-adjusted p shown in the multi-group table.
  • The Cohen's d interval assumes normality; with heavy skew, a bootstrap interval is more honest.

🏁 18. Conclusion

Run the analysis above and this box will summarise your result: t(___) = ___, p = ___, d = ___, with what it means in practice.

What was found

A one sample t test calculator answers one clear question: is the mean of my sample different from a fixed value? It does it by dividing the gap between the sample mean and μ₀ by the standard error, and reading the result on a t distribution with n − 1 degrees of freedom. In the worked example, 16 leaves averaging 52.44 mm gave t(15) = 2.32 and p = 0.035 against the published 50 mm.

What it means in practice

The p-value says whether the difference is likely to be real. The confidence interval says how large it could be, and Cohen's d says whether it is large enough to matter. A good report has all three, plus n, the mean and the SD. A significant result with a negligible d, as in Example 6, should be reported as real but trivial. A non-significant result with a large d, as in Example 5, usually means the study was too small.

Cautions

The test is only as good as its assumptions. Independence matters most, and no test can check it for you. Normality matters in small samples, and outliers matter at every size. When the t test and the Wilcoxon signed-rank test disagree, look at the data before you trust either one. And fix μ₀, the tail and α before you look at the result.

Next steps

Paste your own data into the calculator, read the confidence interval before the p-value, check the four charts, and copy the APA sentence from Section 5. If you need to compare two groups instead, use the paired or independent samples t test. Come back to this one sample t test calculator whenever you need to test a mean against a standard, a target or a published value.

❓ 19. Frequently Asked Questions

What is a one sample t test?

A one sample t test is a hypothesis test that checks whether the mean of one sample differs from a known or hypothesized value, μ₀. It is used when the population standard deviation is unknown and is estimated from the sample. The result is a t statistic with n − 1 degrees of freedom and a p-value.

What is the one sample t test formula?

The formula is t = (x̄ − μ₀) ÷ (s ÷ √n), where x̄ is the sample mean, μ₀ the hypothesized mean, s the sample standard deviation and n the sample size. For 16 leaves with mean 52.44 and SD 4.19 against 50, t = 2.44 ÷ 1.05 = 2.32.

When should you use a one sample t test?

Use a one sample t test when you have one group of continuous measurements and want to compare its mean with a single fixed value, such as a label claim, a reference range or a published mean, and the population standard deviation is unknown. The data should be independent and roughly normal, or n should be 30 or more.

What are the assumptions of a one sample t test?

The assumptions of a one sample t test are: independent observations, a continuous outcome, approximately normal data (less important when n is 30 or more), no extreme outliers, a random sample, and a test value fixed before the data were seen. This calculator checks normality, skewness and outliers automatically.

How do you calculate degrees of freedom for a one sample t test?

The degrees of freedom for a one sample t test are df = n − 1, the sample size minus one. One degree of freedom is used up estimating the sample mean. With 16 observations, df = 15.

How do I calculate the p value for a one sample t test?

First compute t and df = n − 1. For a two-tailed test, p = 2 × P(T ≥ |t|) from the t distribution with df degrees of freedom. In Excel use =T.DIST.2T(ABS(t),df), in R 2*pt(-abs(t),df), and in Python 2*stats.t.sf(abs(t),df). For t = 2.3243 and df = 15, p = 0.0346.

How do I find the critical value for a one sample t test?

Look up t at your α and df = n − 1 in Table 12.1, or use =T.INV.2T(0.05,df) in Excel for a two-tailed test. For df = 15 and α = 0.05, the two-tailed critical value is 2.131 and the one-tailed value is 1.753. Reject H₀ when |t| is larger.

What are the null and alternative hypotheses for a one sample t test?

The null hypothesis is H₀: μ = μ₀, the population mean equals the test value. The two-tailed alternative is H₁: μ ≠ μ₀. A one-tailed alternative is either μ > μ₀ or μ < μ₀, and must be chosen before seeing the data.

How do I calculate Cohen's d for a one sample t test?

Cohen's d for a one sample t test is d = (x̄ − μ₀) ÷ s, the mean difference divided by the sample SD. It also equals t ÷ √n. For the leaf data, d = 2.4375 ÷ 4.1947 = 0.58, a medium effect. Hedges' g multiplies d by 1 − 3 ÷ (4df − 1) to correct small-sample bias.

How do I interpret one sample t test results?

Read the mean difference in real units, then the confidence interval, then t and p, then Cohen's d. If p is below α and μ₀ lies outside the CI, the mean differs significantly from μ₀. The sign of t gives the direction, and d tells you whether the difference is small, medium or large.

How do I report a one sample t test in APA format?

Give the mean and SD, the test value, t with df, the exact p, the CI and d. Example: "Leaf length (M = 52.44 mm, SD = 4.19) was greater than 50 mm, t(15) = 2.32, p = .035, 95% CI [50.20, 54.67], d = 0.58." Section 5 fills this in with your numbers.

What is the difference between a one sample and two sample t test?

A one sample t test compares one group's mean with a fixed number. A two sample (independent samples) t test compares the means of two separate groups with each other, and neither mean is fixed in advance. A one sample t test has df = n − 1; a two sample Student t test has df = n₁ + n₂ − 2.

What is the difference between a one sample t test and a z test?

Both compare a mean with a fixed value. The z test assumes the population standard deviation σ is known and uses the normal distribution. The t test estimates the SD from the sample and uses the t distribution, which has heavier tails for small n. In practice σ is rarely known, so the t test is the usual choice.

Is a paired t test the same as a one sample t test?

Yes, in practice. A paired t test computes the difference for each pair, such as after minus before, and then runs a one sample t test of those differences against 0. You can paste the differences into this calculator with μ₀ = 0 and get exactly the paired t test result.

How do I do a one sample t test in Excel?

Compute t with =(AVERAGE(A2:A17)-50)/(STDEV.S(A2:A17)/SQRT(COUNT(A2:A17))) and p with =T.DIST.2T(ABS(t),COUNT(A2:A17)-1). Or fill column B with 50 and use =T.TEST(A2:A17,B2:B17,2,1). Section 9 shows every step with spreadsheet screenshots.

How do I run a one sample t test in R?

Use t.test(x, mu = 50). Add alternative = "greater" or "less" for a one-tailed test and conf.level = 0.99 to change the interval. Forgetting mu tests against 0. Section 10 has a full script with Cohen's d, a normality check and a 300 dpi figure.

How do I run a one sample t test in Python?

Use scipy.stats.ttest_1samp(x, popmean=50). It returns t and p; .confidence_interval() gives the CI in SciPy 1.10 and newer. Use alternative="greater" or "less" for one tail. Section 11 has a complete script that matches R exactly.

What sample size do I need for a one sample t test?

It depends on the smallest effect you care about. For 80% power at α = 0.05, two-tailed, you need about 199 observations to detect d = 0.2, 34 for d = 0.5 and 15 for d = 0.8. The calculator also reports the n needed to detect the effect you observed.

What if my data are not normally distributed?

With 30 or more observations and no extreme outliers, the one sample t test is usually still accurate. With a small, skewed sample or clear outliers, use the Wilcoxon signed-rank test, which this calculator runs automatically as a cross-check. If both tests agree, you can report the t test with confidence.

What does a one sample t test tell you?

A one sample t test tells you whether the difference between your sample mean and a fixed value is larger than random sampling would usually produce. It gives the direction (sign of t), the strength of evidence (p) and, with the CI, the range of plausible population means. It does not tell you whether the difference is important; Cohen's d helps with that.

📑 20. Cite This Tool

APA 7th edition
StatsUnlock. (2026). One sample t test calculator [Interactive statistical tool]. https://statsunlock.com/one-sample-t-test-calculator/
BibTeX
@misc{statsunlock_onesamplet_2026, title={One Sample t Test Calculator}, author={{StatsUnlock}}, year={2026}, note={Interactive statistical tool}, url={https://statsunlock.com/one-sample-t-test-calculator/}}
Methods wording
The sample mean was compared with the hypothesized value using a two-tailed one-sample t-test (alpha = .05) in the StatsUnlock One Sample t Test Calculator (2026). Effect size was expressed as Cohen's d with a noncentral-t confidence interval, and normality was assessed with the Shapiro-Wilk test. Run the analysis to insert your numbers.

🔗 21. Related Tools

📖 22. Glossary of Terms

TermPlain-English meaning
Alpha (α)The false-positive rate you accept, chosen before the test. Usually 0.05.
Alternative hypothesis (H₁)The claim that the population mean is different from, above or below the test value.
Cohen's dThe mean difference divided by the standard deviation. It shows the size of an effect in SD units.
Confidence interval (CI)A range of plausible values for the population mean. A 95% CI is built so that 95% of such intervals contain the true mean.
Critical valueThe cut-off for t. If the observed t is further from zero, the result is significant.
Degrees of freedom (df)The number of values free to vary once the mean is known. For a one sample t test, n − 1.
Effect sizeA number that describes how big a difference is, separate from how sure we are about it.
Hedges' gCohen's d with a small correction that removes its upward bias in small samples.
Holm correctionA way to adjust p-values when several tests are run, so the overall false-positive rate stays at α.
Hypothesized mean (μ₀)The fixed value the sample mean is compared with, such as a norm or a target.
Noncentral t distributionThe shape t takes when the null hypothesis is false. It is used for power and for the CI of d.
Null hypothesis (H₀)The claim that the population mean equals the test value.
One-tailed testA test that looks for a difference in only one direction, chosen in advance.
OutlierA value far from the rest. Here, any value beyond 1.5 times the interquartile range outside the quartiles.
p-valueThe probability of a result at least this extreme if the null hypothesis were true.
PowerThe chance a test finds a real difference of a given size.
Q-Q plotA chart of sorted data against what normal data would look like. Points on the line mean the data are close to normal.
Sample standard deviation (s)The typical distance of values from the mean, computed with n − 1.
Shapiro-Wilk testA test of whether data could come from a normal distribution. A small p suggests they do not.
Standard error (SE)How much the sample mean would vary from sample to sample: s divided by the square root of n.
t distributionA bell-shaped curve with heavier tails than the normal curve. Its shape depends on df.
t statisticHow many standard errors the sample mean is from the test value.
Two-tailed testA test that looks for a difference in either direction. The usual default.
Wilcoxon signed-rank testA test of the median against a value that uses ranks, so it is not upset by outliers or skew.

📚 23. References

The following peer-reviewed references support the methods used in this one sample t test calculator: the t distribution, normality testing, effect sizes and their intervals, power, and good practice in reporting p-values.

  1. Student. (1908). The probable error of a mean. Biometrika, 6(1), 1–25. https://doi.org/10.1093/biomet/6.1.1
  2. Shapiro, S. S., & Wilk, M. B. (1965). An analysis of variance test for normality (complete samples). Biometrika, 52(3–4), 591–611. https://doi.org/10.1093/biomet/52.3-4.591
  3. Royston, P. (1995). Remark AS R94: A remark on algorithm AS 181: The W-test for normality. Journal of the Royal Statistical Society, Series C (Applied Statistics), 44(4), 547–551. https://doi.org/10.2307/2986146
  4. Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics Bulletin, 1(6), 80–83. https://doi.org/10.2307/3001968
  5. Cohen, J. (1992). A power primer. Psychological Bulletin, 112(1), 155–159. https://doi.org/10.1037/0033-2909.112.1.155
  6. Hedges, L. V. (1981). Distribution theory for Glass's estimator of effect size and related estimators. Journal of Educational Statistics, 6(2), 107–128. https://doi.org/10.3102/10769986006002107
  7. Lakens, D. (2013). Calculating and reporting effect sizes to facilitate cumulative science: A practical primer for t-tests and ANOVAs. Frontiers in Psychology, 4, 863. https://doi.org/10.3389/fpsyg.2013.00863
  8. Lakens, D. (2017). Equivalence tests: A practical primer for t tests, correlations, and meta-analyses. Social Psychological and Personality Science, 8(4), 355–362. https://doi.org/10.1177/1948550617697177
  9. Cumming, G. (2014). The new statistics: Why and how. Psychological Science, 25(1), 7–29. https://doi.org/10.1177/0956797613504966
  10. Wasserstein, R. L., & Lazar, N. A. (2016). The ASA statement on p-values: Context, process, and purpose. The American Statistician, 70(2), 129–133. https://doi.org/10.1080/00031305.2016.1154108
  11. Greenland, S., Senn, S. J., Rothman, K. J., Carlin, J. B., Poole, C., Goodman, S. N., & Altman, D. G. (2016). Statistical tests, P values, confidence intervals, and power: A guide to misinterpretations. European Journal of Epidemiology, 31(4), 337–350. https://doi.org/10.1007/s10654-016-0149-3
  12. Benjamin, D. J., Berger, J. O., Johannesson, M., Nosek, B. A., Wagenmakers, E.-J., Berk, R., … Johnson, V. E. (2018). Redefine statistical significance. Nature Human Behaviour, 2(1), 6–10. https://doi.org/10.1038/s41562-017-0189-z
  13. Nuzzo, R. (2014). Scientific method: Statistical errors. Nature, 506(7487), 150–152. https://doi.org/10.1038/506150a
  14. Sullivan, G. M., & Feinn, R. (2012). Using effect size, or why the P value is not enough. Journal of Graduate Medical Education, 4(3), 279–282. https://doi.org/10.4300/JGME-D-12-00156.1
  15. Faul, F., Erdfelder, E., Lang, A.-G., & Buchner, A. (2007). G*Power 3: A flexible statistical power analysis program for the social, behavioral, and biomedical sciences. Behavior Research Methods, 39(2), 175–191. https://doi.org/10.3758/BF03193146
  16. Ghasemi, A., & Zahediasl, S. (2012). Normality tests for statistical analysis: A guide for non-statisticians. International Journal of Endocrinology and Metabolism, 10(2), 486–489. https://doi.org/10.5812/ijem.3505
  17. Lumley, T., Diehr, P., Emerson, S., & Chen, L. (2002). The importance of the normality assumption in large public health data sets. Annual Review of Public Health, 23, 151–169. https://doi.org/10.1146/annurev.publhealth.23.100901.140546
  18. Fagerland, M. W. (2012). t-tests, non-parametric tests, and large studies: A paradox of hypothesis testing? BMC Medical Research Methodology, 12, 78. https://doi.org/10.1186/1471-2288-12-78
  19. Kim, T. K. (2015). T test as a parametric statistic. Korean Journal of Anesthesiology, 68(6), 540–546. https://doi.org/10.4097/kjae.2015.68.6.540
  20. Mackowiak, P. A., Wasserman, S. S., & Levine, M. M. (1992). A critical appraisal of 98.6°F, the upper limit of the normal body temperature, and other legacies of Carl Reinhold August Wunderlich. JAMA, 268(12), 1578–1580. https://doi.org/10.1001/jama.1992.03490120092034
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Important Plots & Charts

Most Popular