在 R 编程中对 t 分布执行概率累积密度分析 – pt()函数
R 语言中的pt()
函数用于返回学生 t 分布的概率累积密度。
Syntax: pt(x, df)
Parameters:
x: Random variable
df: Degree of Freedom
示例 1:
# R Program to perform
# Cumulative Density Analysis
# Calling pt() Function
pt(2, 10)
pt(.542, 15)
输出:
[1] 0.963306
[1] 0.7021105
示例 2:
# R Program to perform
# Cumulative Density Analysis
# Creating a vector
x <- seq(1, 10, by = 1)
# Calling pt() Function
y <- pt(x, 2)
# Plotting probability distribution graph
plot(x, y, type ="l")
输出: