options(scipen=999)
options(digits=9)
cat("\014") # clear screen
rm(list=ls(all=TRUE))


x=seq(from=0,to=50,by=0.001)
plot(x,dchisq(x,df=10),
     xlim=c(0,50),
     ylim=c(0,0.1),
     lwd=2,
     type="l",axes=TRUE,
     col="blue",
     tck=0.05,
     xaxs="i",yaxs="i",
     col.sub="Black",
     col.main="Green",
     xlab="x",
     ylab="f(x)",
     main="Chisquare Distribution",
     sub="B(v=10) R(v=15) G(v=20) black(v=25)")
lines(x,dchisq(x,df=15),type="l",col="red")
lines(x,dchisq(x,df=20),type="l",col="green")
lines(x,dchisq(x,df=25),type="l",col="black")


cat("\014") # clear screen

x=seq(from=5,to=40,by=5)
f.x=dchisq(x,df=24)
table=data.frame(x,f.x)
table

x=seq(0,60,by=0.1)
plot(x,dchisq(x,df=24),type="l")