plot_chisq: Plot a Chi-square Distribution with Shading

View source: R/plot_chisq.R

plot_chisqR Documentation

Plot a Chi-square Distribution with Shading

Description

Draw a chi-square distribution curve with appropriate shading to the right of the test statistic for chi-square hypothesis tests

Usage

plot_chisq(df, shadeValues = NULL, col.shade = "cornflowerblue", ...)

Arguments

df

The degrees of freedom for the chi-square distribution

shadeValues

A single value that identifies the boundary of the shaded region

col.shade

The color of the shaded region

...

Other graphical parameters passed to plot (e.g., xlim, main, etc.). Generally, these will not control the shading, only the normal distribution curve.

Details

Since shadeValues is a single number, the shaded region will be to the right of shadeValues since we are interested only in chi-square hypothesis testing.

Value

A plot of a chi-square distribution curve with optional shading.

See Also

plot_norm

Examples


# Shade the area for the chi-square test statistic of 4.1 with degrees of freedom 2.
plot_chisq(df = 2, shadeValues = 4.1)

# Shade the area for the chi-square test statistic of 8.223 with degrees of freedom 10.
plot_chisq(df = 10, shadeValues = 8.233)

STATS250SBI/stats250sbi documentation built on March 18, 2022, 1:14 p.m.