[R] plotting functions of chi square

Ben Bolker bbolker at gmail.com
Tue Aug 17 23:41:42 CEST 2010

maiya <maja.zaloznik <at> gmail.com> writes:

> Thanks, but that wasn't what I was going for. Like I said, I know how to do a
> simple chi-square density plot with dchisq(). 
> What I'm trying to do is chi-square / degrees of freedom. Hence
> rchisq(100000,i)/i).
> How do I do that with dchisq?

  By explicitly using the formula to change variables:


dscchisq <- function(x,df) {

  note that density() generates a smoothing artifact near zero ...

More information about the R-help mailing list