I have a quick question which is very simple but I seem to have a mental block! I'm using the pchisq function to specify a Chi Squared distribution with 9 df which I'm then going to use in the Kolmogorov-Smirnov Test to test some simulated values. so simply: pchisq(q, df=9) I know that q is the vector of quantiles but could anybody tell me what exactly this vector needs to contain? Many Thanks 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
You should be able to do ks.test( x, "pchisq", df=9) to do a KS test on data 'x' against a chi-square with 9 df. For example, > x <- rchisq(1000,df=9) > ks.test( x, "pchisq", df=9) ?One-sample Kolmogorov-Smirnov test data: x D = 0.0192, p-value = 0.8568 alternative hypothesis: two.sided See the ks.test help page for more details. -Greg> -----Original Message----- > From: Bayesianbay at aol.com [mailto:Bayesianbay at aol.com] > Sent: Monday, October 14, 2002 1:11 PM > To: r-help at stat.math.ethz.ch > Subject: [R] Vector of quantiles > > > I have a quick question which is very simple but I seem to > have a mental > block! > > I'm using the pchisq function to specify a Chi Squared > distribution with 9 df > which I'm then going to use in the Kolmogorov-Smirnov Test to > test some > simulated values. > > so simply: pchisq(q, df=9) > > I know that q is the vector of quantiles but could anybody > tell me what > exactly this vector needs to contain? > > Many Thanks > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. > _._._._._._._._._ >LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I am not sure I saw where is your trouble, but may be a figure will help to see... q <- seq(0.1, 30) p <- pchisq(q, df=9) plot(q, p, type="l", xlab="quantiles") points(q, rep(0, length(q)), col="red", pch="+") Hopin' it helps, Laurent On Mon, Oct 14, 2002 at 01:10:44PM -0400, Bayesianbay at aol.com wrote:> I have a quick question which is very simple but I seem to have a mental > block! > > I'm using the pchisq function to specify a Chi Squared distribution with 9 df > which I'm then going to use in the Kolmogorov-Smirnov Test to test some > simulated values. > > so simply: pchisq(q, df=9) > > I know that q is the vector of quantiles but could anybody tell me what > exactly this vector needs to contain? > > Many Thanks > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._-- -------------------------------------------------------------- Laurent Gautier CBS, Building 208, DTU PhD. Student DK-2800 Lyngby,Denmark tel: +45 45 25 24 89 http://www.cbs.dtu.dk/laurent -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._