[R] R: pp plot
Peter Dalgaard
p.dalgaard at biostat.ku.dk
Tue Nov 22 15:05:01 CET 2005
Clark Allan <Allan at STATS.uct.ac.za> writes:
> the distribution is not a standard one
As long as it has a CDF and a density it doesn't seem to matter if you
just follow the naming conventions:
qfoo <- qnorm
dfoo <- dnorm
z <- rnorm(50)
qq.plot(z,"foo")
The code for qq.plot.default appears quite readable and should also
provide you an answer to the theoretical side of your question. Notice
however, that the technique relies on the approximation of the
binomial distribution by a normal one and on the delta method, so is
not going to be very accurate in the tails. I suspect that you can do
somewhat better by using exact confidence intervals for the binomial
distribution, or (likely better) the beta distribution of the order
statistics in the uniform distribution.
(BTW, P-P plots are often useless because they cannot resolve
discrepancies in small p-values. At the very least you want to use
log="xy". Q-Q plots are much better in this respect.)
> P Ehlers wrote:
> >
> > Is qq.plot in package 'car' of use to you? I think that it
> > requires your distribution to be one of those available in R.
> >
> > Peter
> >
> > Clark Allan wrote:
> > > hi all
> > >
> > > i would like to know if anyone has a reference on how one would place
> > > the "bands" on the pp plot.
> > >
> > > i want to test whether or not a certain data set comes from a particular
> > > distribution (not normal).
> > >
> > > i've already plotted F(X(j)) vs j/(n+1) where F(x) is the cum dist
> > > function, X(j) is the j'th order statistic and n is the sample size.
> > >
> > > a goole search gave arb references and thought some one one the list
> > > should definitely know how to solve this problem.
> > >
> > > thanking you in advance
> > > allan
--
O__ ---- Peter Dalgaard Øster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help
mailing list