Calculator
Example data table
This sample is also available via “Load sample dataset”.
| # | x | y |
|---|---|---|
| 1 | 1 | 2.2 |
| 2 | 2 | 2.8 |
| 3 | 3 | 3.6 |
| 4 | 4 | 4.1 |
| 5 | 5 | 5.2 |
| 6 | 6 | 5.7 |
| 7 | 7 | 6.8 |
| 8 | 8 | 7.4 |
Formula used
The core coefficient test uses the t statistic: t = (β̂ − β₀) / SE(β̂). The p value is computed from the Student's t distribution with the appropriate degrees of freedom.
In simple linear regression, with paired data (xᵢ, yᵢ), the fitted model is ŷ = β̂₀ + β̂₁x. The slope estimate is β̂₁ = Sxy / Sxx, where Sxx = Σ(xᵢ − x̄)² and Sxy = Σ(xᵢ − x̄)(yᵢ − ȳ).
Residual standard error is s = √(SSE / (n − 2)), with SSE = Σ(yᵢ − ŷᵢ)². Then SE(β̂₁) = s / √Sxx and SE(β̂₀) = s·√(1/n + x̄²/Sxx).
How to use this calculator
- Choose a mode: data-based (X,Y) or manual (β̂, SE, df).
- Set α and select the tail that matches your hypothesis.
- Enter your values, then click Calculate.
- Review t, p value, critical t, and the decision line.
- Download the output as CSV or PDF when needed.
What the t statistic measures in regression
This calculator evaluates a regression coefficient by comparing an estimate to a hypothesized value. It uses t = (β̂ − β₀) / SE(β̂). The standard error reflects residual spread and, for the slope, how widely x values vary. Large |t| means the estimate sits many standard errors from the hypothesis. Many workflows test β₀ = 0 to check whether a predictor adds signal.
How degrees of freedom shape the test
Degrees of freedom determine the reference distribution used for p values and critical limits. In simple regression, df = n − 2 because the intercept and slope are estimated from the same data. In broader models, df typically equals n − k − 1. Smaller df implies heavier tails and weaker evidence for a given t. As df rises, critical t approaches 1.96 at α = 0.05.
Interpreting p values and alpha
The p value is the chance of seeing an equally extreme statistic if the null is true. Two‑tailed tests look in both directions; one‑tailed tests look only left or right. The calculator compares p to α and returns a decision rule plus a two‑sided confidence interval. If the interval excludes β₀, it aligns with rejecting at that α. For two‑tailed tests, α is split across both tails so the critical value is based on α/2 of the distribution.
Using dataset mode for quick model checks
Enter paired X and Y lists to fit ŷ = β̂₀ + β̂₁x and compute SEs from SSE and df. The output includes R² and residual standard error to summarize fit. You can set hypothesized slope and intercept values for benchmarking. On the built‑in example (n = 8, df = 6), β̂₁ ≈ 0.759524 and β̂₀ ≈ 1.307143. The slope t statistic is ≈ 31.534, R² ≈ 0.994002, residual SE ≈ 0.156093, and SE(β̂₁) ≈ 0.024086.
Reporting results with exports
Use the CSV export to capture the tables for spreadsheets, documentation, or analysis notes. Use the PDF export for a clean, printable summary that preserves α, tail choice, and coefficient tests. Pair exported numbers with context such as units, sampling window, and exclusions so others can reproduce the result.
How do I enter X and Y data?
Paste numbers separated by spaces, commas, or new lines. Provide the same count for X and Y. Dataset mode fits a simple line and tests slope and intercept automatically.
Can I use this for multiple regression output?
Yes. Use manual mode with your coefficient estimate, its standard error, and the correct degrees of freedom from your model output to compute t and p quickly.
What does the tail option change?
Tail selection changes how “extreme” is defined for p values and critical t. Choose two‑tailed for “different,” right‑tailed for “greater,” and left‑tailed for “less.”
Why is df equal to n − 2 in simple regression?
Two parameters are estimated from the same data: intercept and slope. With n observations, that leaves n − 2 independent pieces of information to estimate residual variance.
How are critical values calculated?
Critical t comes from the t distribution using df and your α. For two‑tailed tests the calculator uses α/2 per tail; one‑tailed tests use α in one direction.
What is included in CSV and PDF exports?
Exports include the result tables shown on screen, such as t statistics, p values, confidence bounds, and fitted‑value previews when available. CSV is easy to reuse; PDF is designed for sharing and printing.