Displaying 20 results from an estimated 2000 matches similar to: "Bug/Wishlist: 'partial' in 'sort' and 'quantile' (PR#8650)"
2000 Dec 11
1
qqline (PR#764)
I think qqline does not do exactly what it is advertised to do ("`qqline'
adds a line to a normal quantile-quantile plot which passes through the
first and third quartiles."). Consider the graph:
tmp <- qnorm(ppoints(10))
qqnorm(tmp)
qqline(tmp)
The line (which I expected go through all the points), has a slightly
shallower slope than does the points plotted by qqnorm. I think
1998 Sep 03
2
ppoints
When I look at ppoints I see:
ppoints<-function (x)
{
n <- length(x)
if (n == 1)
n <- x
(1:n - 0.5)/n
}
However Venables & Ripley (2nd ed, p 165) say ppoints() should return
(i-1/2)/n for n>=11; (i-3/8)/(n+1/4) for n<=10.
The version below should work as described:
ppoints<-function (x)
{
n <- length(x)
if (n <= 10)
(1:n - 0.375)/(n + 0.25)
else
(1:n - 0.5)/n
2007 Feb 08
1
the plotting position of theoretical quantile for qqnorm
Hello,
I have a doubt about the plotting position of the theoretical quantile for
the qqnorm
command in R.
Let F be the theoretical distribution of Y, we observed a sample of size n,
y1,y2, ...,
yn. We then sort it and comspare these empirical quantiles to the expected
ones
from F. For the plotting poition, there are several options:
1. i/(n+1)
2. (i-.375)/(n+.25)
3. (i- .3175)/ (n + .365)
etc.
2005 Jan 19
1
ppoints (PR#7538)
Dear r-bugs,
Whilst playing with ppoints I discovered
that when one uses it directly, occasional
NA's in a vector also become data fractions:
ppoints(c(1,2,NA,4))
Would it be a good idea to add a warning message
as in:
ppoints <- function (n, a = ifelse(n <= 10, 3/8, 1/2))
{
if(any(is.na(n))) warning("'n' contains NA's")
if(length(n) > 1) n <-
1999 Aug 31
1
Suggestion for qqplot() improvement
>>>>> On Tue, 31 Aug 1999 14:57, Werner Stahel <stahel@stat.math.ethz.ch> said:
WSt> Here is a suggestion. It seems that qqplots, comparing a sample
WSt> to a distribution other than the normal, are not explicitly
WSt> available in S or R. I found
(in S-plus / Trellis it is, see below)
WSt> qqplot(y, rt(300, df = 5))
WSt> as an
2006 Apr 13
2
Plotting positions in qqnorm?
Do you know of a reference that discusses alternative choices for
plotting positions for a normal probability plot? The documentation for
qqnorm says it calls ppoints, which returns qnorm((1:m-a)/(m+1-2*a))
with "a" = ifelse(n<=10, 3/8, 1/2)? The help pages for qqnorm and
ppoints just refer to Becker, Chambers and Wilks (1988) The New S
Language (Wadsworth & Brooks/Cole),
2012 May 11
1
identify() doesn't return "true" numbers
Dear R community.
I am using the identify() function to identify outliers in my dataset.
This is the code I am using:
####################################################################
# Function to allow identifying points in the QQ plot (by mouseclicking)
qqInteractive <- function(..., IDENTIFY = TRUE)
{
qqplot(...) -> X
abline(a=0,b=1)
if(IDENTIFY) return(identify(X))
2007 Jun 19
2
Function -return value
Hi, I am trying to write a function with the following codes and I would like
it to return the values for "alpha
beta para parab " seperately. Then I would like to use this funstion for
"variable" with factor "a" and "b". But the result turns out to be a matrix
with element like "Numeric,2" ... I guess they are just the values for
2005 Nov 25
0
'partial' in sort() inefficient?
I often need to work with large vectors whose distribution I want to
summarize by Q-Q plots. Since the vectors are large, I use a subset
of quantiles, e.g.
quantile(x, probs = ppoints(1000))
Unfortunately, this seemed to be taking too long for large x (much
longer than 'sort'). I initially thought maybe quantile was doing
something sophisticated (which I don't really need with a
2007 Jun 09
1
What ECDF function?
Hello!
I want to plot a P-P plot. So I've implemented this function:
ppplot <- function(x,dist,...)
{
pdf <- get(paste("p",dist,sep=""),mode="function");
x <- sort(x);
plot( pdf(x,...), ecdf(x)(x));
}
I have two questions:
1. Is it right to draw as reference line the following:
xx <- pdf(x,...);
yy <- ecdf(x)(x);
l <- lm(
2005 Apr 28
3
have to point it out again: a distribution question
Stock returns and other financial data have often found to be heavy-tailed.
Even Cauchy distributions (without even a first absolute moment) have been
entertained as models.
Your qq function subtracts numbers on the scale of a normal (0,1)
distribution from the input data. When the input data are scaled so that
they are insignificant compared to 1, say, then you get essentially the
2009 Sep 17
2
QQ plotting of various distributions...
Hello!
I am trying with this question again:
I would like to test few distributional assumptions for some behavioral
response data. There are few theories about true distribution of those
data, like: normal, lognormal, gamma, ex-Gaussian
(exponential-Gaussian), Wald (inverse Gaussian) etc. The best way would
be via qq-plot, to show to students differences. First two are trivial:
qqnorm(dat$X)
2013 Apr 01
1
95% Confidence Interval for a p-p plot
Hi,
I want to create upper and lower 95% confidence intervals for a p-p plot of
an empirical distribution with a theoretical gamma distribution.
This is my code:
x<-rgamma(100,shape=2, rate=1) # empirical data
fitdistr(x,"gamma") # fit a gamma distribution
dist<-pgamma(x,shape=1.9884256 ,rate=0.8765314 ) # fitted distribution,
using the loglikelihood estimated parameters
2005 Mar 28
1
Reading data from "clipboard"
Dear List,
As a way to learn R, I am trying out some of the
examples shown in the Reference Cards.
I use the following to read a column of numbers from
Excel:
x <- read.delim("clipboard")
My questions are:
1. Why is it that the first number is omitted from the
selected data range? How do I tell R to pick up the
first number as part of the entire selection?
2. The next thing I
1999 Mar 16
1
qqnorm in R-0.63.3
Dear List,
invoking qqnorm-plots in Version 63.3 produces funny things:
using the option `type="s"ยด on qqnorm should give a nice *line* of
observed quantiles. Now, the line is walking along in order to the
points index instead from lowest to highest, wich makes funny slopes.
try x <- table(rnorm(1000) # or similar and
qqnorm(x,type="s") # in 0.63.2 and 63.3
Well, the
2006 Jul 28
1
Normal score transform of spatial data
List:
I have 2 related questions:
(1) first I have x-y-z data, where x & y are the geographic locations of
point values, z. I need to perform a normal score transform on the
z-values and maintain their geographic location. So, how do I go from
columns x-y-z to x-y-z-t (or x-y-t), where the t-values are the normal
score transforms of the z-values? Can I use qnorm(ppoints(data)) to do
2008 Sep 15
0
how to calculate PPCC?
hi,
I wrote a set of R functions for estimating what is the probability
function that best fits a set of data. I wrote them based in this response:
/http://tolstoy.newcastle.edu.au/R/help/03b/1714.html/
I extracted the relevant segment of the link above:
//> PPCC <- function(shape, scale, x) { # only for weibull /
+ x <- sort(x)
+ pp <- ppoints(x)
+ cor( qweibull(pp, shape=shape,
2006 Mar 11
1
Quicker quantiles?
Motivated by Deepayan's recent inquiries about the efficiency of the
R 'quantile'
function:
http://tolstoy.newcastle.edu.au/R/devel/05/11/3305.html
http://tolstoy.newcastle.edu.au/R/devel/06/03/4358.html
I decided to try to revive an old project to implement a version of
the Floyd
and Rivest (1975) algorithm for finding quantiles with O(n)
comparisons. I
used
2011 Nov 16
2
outlier identify in qqplot
Dear Community,
I want to identify outliers in my data. I don't know how to use identify
command in the plots obtained.
I've gone through help files and use mahalanobis example for my purpose:
NormalMultivarianteComparefunc <- function(x) {
Sx <- cov(x)
D2 <- mahalanobis(x, colMeans(x), Sx)
plot(density(D2, bw=.5), main="Squared Mahalanobis distances, n=nrow(x),
2010 Mar 27
5
producing a QQ plot.
Hello everyone I'm a beginner in Stats and R, I'm using R 2.10.1. I need to
create a multivariate qq plot, there is 8 variable group with each has 55
number of input. An example of what I did so far, just to get my point out:
> data=read.csv(file.choose(),header=T)
> data
country village group av_expen P2ary_ed no_fisher
1 Cook Islands Aitutaki D