Created
May 17, 2011 21:35
-
-
Save reyjrar/977455 to your computer and use it in GitHub Desktop.
Graph a Chi-Squared Distribution with 5 Degrees of Freedom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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