Hi:

On Tue, Aug 17, 2010 at 2:28 PM, maiya <maja.zaloznik@gmail.com> wrote:

>
> 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?
>

You write a function. Compare the following:

# chi-square densities:

curve( dchisq(x, df=5), 0, 50, col='red')
curve( dchisq(x, df=10), 0, 50, col='blue', add = TRUE)
curve( dchisq(x, df=20), 0, 50, col='green', add = TRUE)

# chi-square density/df:
g <- function(x, df)  dchisq(x, df)/df

curve(g(x, df = 5), 0, 50)
curve(g(x, df = 10), 0, 50, col = 'blue', add = TRUE)
curve(g(x, df = 20), 0, 50, col = 'green', add = TRUE)

Is that what you're after?

HTH,
Dennis

> --
> View this message in context:
> http://r.789695.n4.nabble.com/plotting-functions-of-chi-square-tp2329020p2329057.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.
>

	[[alternative HTML version deleted]]

