[R] Chi-Square Distribution Plots

Ben Bolker ben at zoo.ufl.edu
Mon Sep 30 15:24:40 CEST 2002



  How about something like (untested)

curve(dchisq(x,df=df),add=TRUE)

 [you'll need to make sure that you've plotted your histogram with 
freq=FALSE]

On Mon, 30 Sep 2002 Bayesianbay at aol.com wrote:

> Dear list
> 
> I have a vector of values that allegedly have a chi-squared distribution. I 
> want to create a plot that shows the values I have obtained,  and the 
> chi-squared distribution curve for the specified number of degrees of freedom 
> to show what should have been obtained.
> 
> At the moment I am plotting the values I have obtained as a histogram and 
> somehow want to put on to this plot the expected frequency curve. Is there a 
> way of doing this in R?
> 
> Many thanks in davance
> Laura
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-- 
318 Carr Hall                                bolker at zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list