Skip to content
Related Articles

Related Articles

Compute value of Quantile Chi Square Density in R Programming – qchisq() Function
  • Last Updated : 25 Jun, 2020
GeeksforGeeks - Summer Carnival Banner

qchisq() function in R Language is used to compute value of chi square quantile function. It creates a quantile function plot for chi square distribution.

Syntax: qchisq(vec, df)

Parameters:
vec: Vector of x-values
df: Degree of Freedom

Example 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

Output:



 [1] 0.000000 1.610308 2.342534 2.999908 3.655500 4.351460 5.131867 6.064430
 [9] 7.289276 9.236357      Inf

Example 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)

Output:

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :