# t-test and z-test calculator

> t-test calculator for one-sample, two-sample (Welch or pooled) and paired tests, plus z-tests for a mean or proportion: p-value, critical value, decision.

ஊடாடும் பதிப்பு: https://www.calcopenly.com/ta/statistics/t-test-calculator
பாடப்பிரிவு: புள்ளியியல் மற்றும் நிகழ்தகவுக் கணிப்பான்கள்

A t-test divides the gap between a sample mean and a hypothesised value, or between two sample means, by its standard error. The ratio follows Student's t distribution with n − 1 degrees of freedom for one sample or for paired differences, n₁ + n₂ − 2 for the pooled two-sample test, and the Welch–Satterthwaite value when the variances may differ. With a known population σ the same ratio is a z statistic; the proportion test compares a sample proportion with p₀ the same way.

Quality checks, A/B tests and before-and-after studies are typical uses. The default data are 12 fill weights tested against a target of 500: the mean is 498.64, t = −2.395 on 11 df and the two-sided p = 0.0355, so the mean differs from 500 at α = 0.05.

The t-tests assume independent observations from roughly normal populations. Larger samples tolerate more skew, because the distribution of the sample mean approaches normal as n grows.

## உள்ளீடுகள்

- **Test** (விருப்பங்கள்: One-sample t-test, One-sample z-test (σ known), Two-sample t-test, Welch (unequal variances), Two-sample t-test, pooled variance, Paired t-test, One-proportion z-test)
- **Enter** (விருப்பங்கள்: Raw data, Summary statistics)
- **Sample 1**: For a paired test, the first measurement of each pair.
- **Sample 2**: For a paired test, the second measurement, in the same order.
- **Sample 1 mean**: For a paired test, the mean of the differences.
- **Standard deviation s₁**: For a paired test, the SD of the differences.
- **Sample size n₁**
- **Sample 2 mean**
- **Standard deviation s₂**
- **Sample size n₂**
- **Known population σ**
- **Hypothesised mean μ₀**
- **Hypothesised difference Δ₀**: Mean of sample 1 minus sample 2 under H₀ (usually 0).
- **Successes x**
- **Sample size n**
- **Hypothesised proportion p₀**
- **Alternative hypothesis** (விருப்பங்கள்: ≠ (two-sided), < (left-tailed), > (right-tailed))
- **Significance level α**

## முடிவுகள்

- p-value — முதன்மை முடிவு
- Decision
- Test statistic
- Degrees of freedom
- Critical value
- Estimate
- Standard error

## சூத்திரம்

$$
t = \frac{\bar x - \mu_0}{s/\sqrt n},\qquad t_{\text{Welch}} = \frac{\bar x_1 - \bar x_2 - \Delta_0}{\sqrt{s_1^2/n_1 + s_2^2/n_2}},\qquad z = \frac{\hat p - p_0}{\sqrt{p_0(1-p_0)/n}}
$$

## தீர்க்கப்பட்ட எடுத்துக்காட்டுகள்

### One-sample t on fill weights (defaults)

- Test: One-sample t-test
- Enter: Raw data
- Sample 1: 498.2, 501.3, 497.6, 499.1, 495.8, 500.4, 496.9, 498.7, 497.3, 499.8, 502.1, …
- Hypothesised mean μ₀: 500
- Alternative hypothesis: ≠ (two-sided)
- Significance level α: 0.05
- **Test statistic: -2.395294**
- **Degrees of freedom: 11**
- **p-value: 0.035527**
- **Decision: Reject H₀**
- **Critical value: 2.201**
- சரிபார்ப்பின் மூலம்: Python statistics.mean/stdev for t; p-value from the A&S 26.7.3 closed form for odd ν (pyref.t_cdf_int); t₀.₉₇₅,₁₁ = 2.201 (t table)

### Welch t from summary statistics

- Test: Two-sample t-test, Welch (unequal variances)
- Enter: Summary statistics
- Sample 1 mean: 20.1
- Standard deviation s₁: 3.2
- Sample size n₁: 15
- Sample 2 mean: 17.4
- Standard deviation s₂: 4.8
- Sample size n₂: 12
- Hypothesised difference Δ₀: 0
- Alternative hypothesis: ≠ (two-sided)
- Significance level α: 0.05
- **Test statistic: 1.673611**
- **Degrees of freedom: 18.3865**
- **p-value: 0.111135**
- சரிபார்ப்பின் மூலம்: Welch–Satterthwaite df in Python fractions; p-value by Gauss–Legendre quadrature of the t density (pyref.t_sf_numeric)

### Pooled t on the same summaries

- Test: Two-sample t-test, pooled variance
- Enter: Summary statistics
- Sample 1 mean: 20.1
- Standard deviation s₁: 3.2
- Sample size n₁: 15
- Sample 2 mean: 17.4
- Standard deviation s₂: 4.8
- Sample size n₂: 12
- Hypothesised difference Δ₀: 0
- Alternative hypothesis: ≠ (two-sided)
- Significance level α: 0.05
- **Test statistic: 1.749856**
- **Degrees of freedom: 25**
- **p-value: 0.09241**
- சரிபார்ப்பின் மூலம்: Pooled variance in Python fractions; p-value from the A&S 26.7.3 closed form with ν = 25

### Paired t, right-tailed

- Test: Paired t-test
- Enter: Raw data
- Sample 1: 142 138 150 145 160 155 139 148
- Sample 2: 136 135 146 144 150 149 138 141
- Hypothesised difference Δ₀: 0
- Alternative hypothesis: > (right-tailed)
- Significance level α: 0.05
- **Test statistic: 4.32649**
- **Degrees of freedom: 7**
- **p-value: 0.001726**
- **Estimate: 4.75**
- சரிபார்ப்பின் மூலம்: Differences' mean and stdev in Python statistics; p-value from the A&S closed form with ν = 7

### One-proportion z, 540 of 1000 vs 0.5

- Test: One-proportion z-test
- Successes x: 540
- Sample size n: 1000
- Hypothesised proportion p₀: 0.5
- Alternative hypothesis: ≠ (two-sided)
- Significance level α: 0.05
- **Test statistic: 2.529822**
- **p-value: 0.011412**
- **Decision: Reject H₀**
- சரிபார்ப்பின் மூலம்: z = 0.04/√(0.25/1000); p = erfc(z/√2) in Python

### One-sample z, right-tailed

- Test: One-sample z-test (σ known)
- Enter: Summary statistics
- Sample 1 mean: 103
- Sample size n₁: 36
- Known population σ: 15
- Hypothesised mean μ₀: 100
- Alternative hypothesis: > (right-tailed)
- Significance level α: 0.05
- **Test statistic: 1.2**
- **p-value: 0.11507**
- **Critical value: 1.6449**
- சரிபார்ப்பின் மூலம்: z table: 1 − Φ(1.20) = 0.1151; Python 0.5·erfc(1.2/√2) = 0.1150697; z₀.₉₅ = 1.644854

## கேள்விகள்

### What does a p-value tell you?

It is the probability of a test statistic at least as extreme as the one observed, assuming the null hypothesis is true. For the default data p = 0.0355: if the true mean were 500, samples at least this far from 500 would turn up about 3.6% of the time. It is not the probability that H₀ is true and it does not measure effect size, as the American Statistical Association's 2016 statement on p-values stresses.

### Should I use Welch's t-test or the pooled t-test?

Use Welch's test unless you have good reason to believe the variances are equal. It drops the equal-variance assumption and loses little power when the variances do match, while the pooled test's false-positive rate drifts from α when variances and group sizes both differ. On the worked example (s = 3.2 and 4.8, n = 15 and 12) Welch gives p = 0.111 on 18.4 df and the pooled test p = 0.092 on 25 df.

### When should I use a paired t-test?

When each value in one sample is matched to one in the other: the same patients before and after treatment, or two instruments measuring the same parts. The test is a one-sample t-test on the differences, which removes the variation between subjects. In the paired worked example eight pairs differ by 4.75 on average, giving t = 4.33 on 7 df and a one-sided p of 0.0017.

### What is the difference between a t-test and a z-test?

A z-test uses a known population standard deviation σ and the standard normal distribution; a t-test estimates σ from the sample and uses Student's t, whose heavier tails allow for that extra uncertainty. The two-sided 5% critical value is 1.960 for z, 2.201 for t with 11 df and 2.042 with 30 df. σ is rarely known in practice, so the t-test is the usual choice for means.

### Should I use a one-tailed or two-tailed test?

Use a two-tailed test unless the direction was fixed before seeing the data and an effect in the other direction would be treated the same as no effect. A one-tailed test puts all of α in one tail, so its p-value is half the two-tailed one when the effect goes the predicted way: t = −2.395 on 11 df gives 0.0355 two-tailed and 0.0178 left-tailed. Picking the tail after looking doubles the real false-positive rate.

### “t-test and z-test calculator” எவ்வளவு துல்லியமானது?

துல்லியம் உங்கள் உள்ளீடுகளையும் முறையின் அனுமானங்களையும் சார்ந்தது. தசமக் கணக்கீடு 50 முக்கிய இலக்கங்களைப் பயன்படுத்துகிறது. ஆனால் மதிப்பீடுகள், எண் முறைகள், மூலத் தரவுகள் குறைந்த துல்லியத்தைக் கொண்டிருக்கலாம்; காட்டப்படும் மதிப்பை வட்டமிடுவது இந்த வரம்புகளை நீக்காது. சுயாதீன மூலங்களின் தீர்வுகளுடன் சரிபார்க்கப்பட்ட எடுத்துக்காட்டுகள்: 7. எடுத்துக்காட்டாக, “One-sample t on fill weights (defaults)” என்பது Python statistics.mean/stdev for t; p-value from the A&S 26.7.3 closed form for odd ν (pyref.t_cdf_int); t₀.₉₇₅,₁₁ = 2.201 (t table) உடன் சரிபார்க்கப்படுகிறது.

### இந்த முறையின் மூலம் என்ன?

NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.3 Two-sample t-test for equal means; NIST/SEMATECH e-Handbook, §7.2.2 Are the data consistent with the assumed process mean?; Welch, B. L. (1947). The generalization of Student's problem when several different population variances are involved. Biometrika 34, 28–35.

## ஆதாரங்கள்

- [NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.3 Two-sample t-test for equal means](https://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm)
- [NIST/SEMATECH e-Handbook, §7.2.2 Are the data consistent with the assumed process mean?](https://www.itl.nist.gov/div898/handbook/prc/section2/prc22.htm)
- Welch, B. L. (1947). The generalization of Student's problem when several different population variances are involved. Biometrika 34, 28–35
