<!DOCTYPE html>
<
html
lang
=
"en"
>
<
head
>
<
meta
charset
=
"UTF-8"
>
<
meta
name
=
"viewport"
content
=
"width=device-width, initial-scale=1.0"
>
<
title
>Inverse t-Distribution Calculator</
title
>
<
script
src
=
</
script
>
</
head
>
<
body
>
<
h1
>Inverse t-Distribution Calculator</
h1
>
<
form
>
<
label
for
=
"prob"
>Probability (p):</
label
>
<
input
type
=
"number"
id
=
"prob"
step
=
"0.01"
min
=
"0"
max
=
"1"
required>
<
br
>
<
label
for
=
"dof"
>Degrees of Freedom (DOF):</
label
>
<
input
type
=
"number"
id
=
"dof"
required>
<
br
>
<
button
type
=
"button"
onclick
=
"inverseT()"
>
Calculate
</
button
>
</
form
>
<
div
id
=
"result"
></
div
>
<
script
>
function fun(p, DOF) {
if (p <
0
|| p > 1) {
return
"Probability value (p) must be between 0 and 1.";
}
const result = jStat.studentt.inv(p, DOF);
return result;
}
function inverseT() {
const probInput =
document.getElementById("prob");
const DOF =
document.getElementById("dof");
const ans =
document.getElementById("result");
const prob = parseFloat(probInput.value);
const dof = parseInt(DOF.value);
const inverseT = fun(prob, dof);
if (typeof inverseT ===
'number' && !isNaN(inverseT)) {
ans.textContent =
`Inverse t-distribution for p=${prob} and DOF=${dof}: ${inverseT}`;
} else {
ans.textContent = inverseT;
}
}
</
script
>
</
body
>
</
html
>