Two Sample t Test Calculator

Run an independent two-sample t test with pooled variance from raw data or summary statistics

Example Results

1 examples

Compare two independent groups

Run a pooled-variance t test for two small independent samples

{
  "result": {
    "tStatistic": 3.4669,
    "pValue": 0.0085,
    "degreesOfFreedom": 8,
    "rejectNull": true
  }
}
View input parameters
{ "group1Values": "102, 98, 101, 105, 100", "group2Values": "95, 97, 94, 99, 96", "group1Mean": 0, "group2Mean": 0, "group1StandardDeviation": 1, "group2StandardDeviation": 1, "group1Size": 0, "group2Size": 0, "hypothesizedDifference": 0, "alternative": "two-sided", "alpha": 0.05, "decimalPlaces": 4 }

Key Facts

Category
Math, Date & Finance
Input Types
textarea, number, select
Output Type
json
Sample Coverage
4
API Ready
Yes

Overview

The Two Sample t Test Calculator allows you to compare the means of two independent groups to determine if there is a statistically significant difference between them. You can input raw comma-separated data or provide summary statistics (mean, standard deviation, and sample size) to instantly calculate the t-statistic, degrees of freedom, and p-value using a pooled variance approach.

When to Use

  • When comparing the average scores or metrics of two distinct, independent groups.
  • When you have either raw dataset values or pre-calculated summary statistics for both samples.
  • When assuming equal variances (pooled variance) between the two independent populations.

How It Works

  • Enter raw data values for Group 1 and Group 2, or input their respective summary statistics (mean, standard deviation, and size).
  • Set the hypothesized difference (usually 0) and choose the alternative hypothesis (two-sided, greater than, or less than).
  • Define your significance level (alpha) and preferred decimal precision.
  • The calculator computes the pooled variance, t-statistic, degrees of freedom, and p-value, indicating whether to reject the null hypothesis.

Use Cases

A/B testing website conversion rates or user engagement metrics between two different landing pages.
Comparing the effectiveness of two different medical treatments or educational interventions on independent patient or student groups.
Analyzing manufacturing quality by comparing the average dimensions or weights of parts from two different production lines.

Examples

1. Evaluating a New Teaching Method

Educator
Background
A teacher wants to know if a new teaching method improves test scores compared to the standard method.
Problem
Needs to compare the test scores of two different classes to see if the difference is statistically significant.
How to Use
Enter the test scores of Class A in Group 1 Values and Class B in Group 2 Values, keep hypothesized difference at 0, and select a two-sided alternative hypothesis.
Example Config
Group 1: 85, 88, 90, 92, 87
Group 2: 78, 80, 85, 82, 79
Alpha: 0.05
Outcome
The calculator outputs the t-statistic and p-value, showing whether the new method resulted in a statistically significant difference in scores.

2. Comparing Production Line Output

Quality Assurance Manager
Background
A QA manager has the summary statistics for the weight of products from two different assembly lines.
Problem
Needs to determine if Line 1 produces significantly heavier products than Line 2 without having the raw data on hand.
How to Use
Leave raw data fields blank. Input the mean, standard deviation, and sample size for both groups, then select 'Greater Than' for the alternative hypothesis.
Example Config
Group 1 Mean: 150, SD: 5, Size: 30
Group 2 Mean: 145, SD: 6, Size: 32
Alternative: greater
Outcome
The tool calculates the pooled variance t-test from the summary stats and confirms if Line 1's output is significantly heavier.

Try with Samples

barcode

Related Hubs

FAQ

Can I use summary statistics instead of raw data?

Yes, you can leave the raw data fields empty and input the mean, standard deviation, and sample size for both groups.

What does pooled variance mean?

Pooled variance assumes that both independent groups have the same population variance, combining their sample variances to estimate it.

What alternative hypotheses are supported?

You can test for a two-sided difference, or one-sided differences (greater than or less than).

What is the alpha value?

Alpha is the significance level (commonly 0.05) used to determine if the p-value is small enough to reject the null hypothesis.

What outputs does the calculator provide?

It returns the calculated t-statistic, p-value, degrees of freedom, and a boolean indicating whether the null hypothesis is rejected.

API Documentation

Request Endpoint

POST /en/api/tools/two-sample-t-test-calculator

Request Parameters

Parameter Name Type Required Description
group1Values textarea No -
group2Values textarea No -
group1Mean number No -
group2Mean number No -
group1StandardDeviation number No -
group2StandardDeviation number No -
group1Size number No -
group2Size number No -
hypothesizedDifference number No -
alternative select No -
alpha number No -
decimalPlaces number No -

Response Format

{
  "key": {...},
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
JSON Data: JSON Data

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-two-sample-t-test-calculator": {
      "name": "two-sample-t-test-calculator",
      "description": "Run an independent two-sample t test with pooled variance from raw data or summary statistics",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=two-sample-t-test-calculator",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]