Learn R Programming

descriptr (version 0.1.0)

chi_plot: Visualize Chi Square Distribution

Description

Visualize how changes in degrees of freedom affect the shape of the chi square distribution. compute\/visualize quantiles out of given probability and probability from a given quantile.

Usage

chi_plot(df = 3, normal = FALSE)

chi_per(probs = 0.95, df = 3, type = c("lower", "upper"))

chi_prob(perc, df, type = c("lower", "upper"))

Arguments

df

degrees of freedom

normal

logical; if TRUE, normal curve with same mean and sd as the chi square distribution is drawn

probs

a probability value

type

lower tail or upper tail

perc

a quantile value

Value

percentile for the probs based on df and type or probability value for perc based on df and type

See Also

Chisquare

Examples

Run this code
# visualize chi square distribution
chi_plot()
chi_plot(df = 5)
chi_plot(df = 5, normal = TRUE)

# compute\/visualize quantiles out of given probability
chi_per(0.165, 8, 'upper')
chi_per(0.22, 13, 'upper')

# compute\/visualize probability from a given quantile.
chi_prob(13.58, 11, 'lower')
chi_prob(15.72, 13, 'upper')

Run the code above in your browser using DataLab