在 R 编程中计算分位数卡方密度的值 – qchisq()函数
R语言中的qchisq()
函数用于计算卡方分位数函数的值。它为卡方分布创建分位数函数图。
Syntax: qchisq(vec, df)
Parameters:
vec: Vector of x-values
df: Degree of Freedom
示例 1:
# R program to compute
# Quantile Chi Square density
# Create a vector of x-values
x <- seq(0, 1, by = 0.1)
# Calling qchisq() Function
y <- qchisq(x, df = 5)
y
输出:
[1] 0.000000 1.610308 2.342534 2.999908 3.655500 4.351460 5.131867 6.064430
[9] 7.289276 9.236357 Inf
示例 2:
# R program to compute
# Quantile Chi Square density
# Create a vector of x-values
x <- seq(0, 1, by = 0.02)
# Calling qchisq() Function
y <- qchisq(x, df = 5)
# Plot a graph
plot(y)
输出: