Skip to main content

@psych/lib@1.24.0
Built and signed on GitHub Actions

A TypeScript library for math, statistics, and data analysis. Featured in psychological and educational research.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
3 weeks ago (1.24.0)
function t2p
t2p(
t: number,
df: number,
twoside?: boolean,
): number

Student's t-distribution t value to p value P value is the probability of the |t| to the right tail if twoside is false otherwise, P value is the probability of the -|t| to the left tail and |t| to the right tail

把 t 分布的 t 值转换为显著性概率值 p 即如果是单侧检验,p 值表示 |t| 的右尾概率 如果是双侧检验,p 值表示 -|t| 的左尾概率和 |t| 的右尾概率

Parameters

t value

degree of freedom

optional
twoside: boolean = true

two side or not (default is true)

Return Type

p value

Throws

Error

degree of freedom must be greater than 0

Add Package

deno add jsr:@psych/lib

Import symbol

import { t2p } from "@psych/lib";

---- OR ----

Import directly with a jsr specifier

import { t2p } from "jsr:@psych/lib";

Add Package

npx jsr add @psych/lib

Import symbol

import { t2p } from "@psych/lib";

Add Package

yarn dlx jsr add @psych/lib

Import symbol

import { t2p } from "@psych/lib";

Add Package

pnpm dlx jsr add @psych/lib

Import symbol

import { t2p } from "@psych/lib";

Add Package

bunx jsr add @psych/lib

Import symbol

import { t2p } from "@psych/lib";