Hi! This is going to be a real newbie question, but I can't figure it out. 

I'm trying to plot densities of various functions of chi-square. A simple
chi-square plot I can do with dchisq(). But e.g. chi.sq/degrees of freedom I
only know how to do using density(rchisq()/df). For example:

plot(1, type="n",  xlab="", ylab="", xlim=c(0,2), ylim=c(0,7))

for (i in c(10,50,100,200,500)){
lines(density(rchisq(100000,i)/i))
}

But even with 100,000 samples the curves still aren't smooth. Surely there
must be a more elegant way to do this?

Thanks!

Maja
-- 
View this message in context: 
http://r.789695.n4.nabble.com/plotting-functions-of-chi-square-tp2329020p2329020.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to