Calculators
One-sample t-test API
Run a one-sample Student's t-test t=(x̄−μ0)/(s/√n) with a two-tailed p-value from the t-distribution, returning the statistic, df, p-value and a reject/fail-to-reject decision. Auditable: echoes sample mean, sd, n. Answers 'is this sample mean different from 5','one-sample t-test p-value','do I reject the null at alpha 0.05'.
Price$0.01per request
MethodPOST
Route/v1/calc/stat-t-test-one-sample
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
calcstatisticst-testhypothesis-testone-samplep-valuestudent-tinference
API URL
Integration docshttps://x402.hexl.dev/v1/calc/stat-t-test-one-sampleExample request
{
"sample": [
5,
6,
7,
8,
9
],
"mu": 5
}Example response
{
"t": 2.828427,
"df": 4,
"pValue": 0.047421,
"alpha": 0.05,
"sampleMean": 7,
"hypothesizedMean": 5,
"sampleSd": 1.581139,
"standardError": 0.707107,
"n": 5,
"rejectNull": true,
"rating": "significant",
"interpretation": "t(4)=2.828, p=0.0474; reject H0 (mean = 5) at alpha=0.05."
}Input schema
{
"type": "object",
"required": [
"sample",
"mu"
],
"properties": {
"sample": {
"type": "array",
"items": {
"type": "number"
},
"description": ">=2 observations",
"examples": [
[
5,
6,
7,
8,
9
]
]
},
"mu": {
"type": "number",
"description": "hypothesized mean μ0",
"examples": [
5
]
},
"alpha": {
"type": "number",
"default": 0.05,
"examples": [
0.05
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}