Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Graph a Chi-Squared Distribution with 5 Degrees of Freedom
# Generic Chi-Squared Graph at 5 D of F.
x <- seq(0, 20, length=100)
hx <- dchisq(x, 5)
plot(x, hx, type="l", col="red", xlab="test statistics",
ylab="Density", main="Chi-Squared Distribution")
segments( x0=9.26, y0=0, x1=9.236, y1=max(hx), lty=2 )
text( 12, 0.12, "cv=9.236" )
legend( "topright", inset=0.05, c("df = 5"), lty=c(1), col=c("red") )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.