Displaying 20 results from an estimated 1000 matches similar to: "probability plot correlation coefficient"
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,
2012 Sep 29
5
Generating by inverting function
Hello,
I am trying to generate random survival times by inverting the function, S(t)= exp(b*F(t)), where b is constant and F(t) is some cumulative distribution function, let say that F(t) is cdf of normal distribution or any others distributions.
as we know that S(t) has uniform distribution on (0,1) so we can write that
U= exp(b*F(t)), where U is uniform (0,1). Now to generat the time t, we
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
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
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
2003 Jul 18
2
Probability plotting with R
Hello,
Our professor asked us to do probability plotting using weibull paper,
exponential paper, normal, log-normal paper, etc. I know I can create Q-Q
plot for normal dist. and see if all te points are on one line. How do I
go about other distributions?
I tried generating different samples and use the general qq function.
However, I could not do it since I don't know the population
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 <-
2008 Aug 28
1
"error using packet 1"
Hello,
I'm Giovanni from ROMA..
I can't find a solution for the error:
"error using packet 1
the y field is not specified and it has not a default value"
(this is my traslation from italian language)
The code is:
pc<- qqmath(~valori,
distribution=function(p) qweibull(p,beta,alpha),
prepanel = prepanel.qqmathline,
panel = function(x, y) {
2008 Aug 28
1
error in packet 1
Hello,
I'm Giovanni from ROMA..
I can't find a solution for the error:
"error using packet 1
the y field is not specified and it has not a default value"
(this is my traslation from italian language)
The code is:
pc<- qqmath(~valori,
distribution=function(p) qweibull(p,beta,alpha),
prepanel = prepanel.qqmathline,
panel = function(x, y) {
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
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
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))
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 Mar 02
2
Bug/Wishlist: 'partial' in 'sort' and 'quantile' (PR#8650)
Hi,
This is essentially a reposting of
http://tolstoy.newcastle.edu.au/R/devel/05/11/3305.html
which had no responses, and the behaviour reported there persists in
r-devel as of yesterday.
(1) sort() with non-null partial
> x = rnorm(100000)
> keep = as.integer(ppoints(10000) * 100000)
> system.time(sort(x))
[1] 0.05 0.00 0.04 0.00 0.00
> system.time(sort(x, partial = keep))
[1]
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.
2001 Jul 02
2
Shapiro-Wilk test
Hi,
does the shapiro wilk test in R-1.3.0 work correctly? Maybe it does, but can
anybody tell me why the following sample doesn't give "W = 1" and
"p-value = 1":
R> x<-1:9/10;x
[1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
R> shapiro.test(qnorm(x))
Shapiro-Wilk normality test
data: qnorm(x)
W = 0.9925, p-value = 0.9986
I can't imagine a sample being
2008 Aug 21
1
pnmath compilation failure; dylib issue?
(1) ...need to speed up a monte-carlo sampling...any suggestions about
how I can get R to use all 8 cores of a mac pro would be most useful
and very appreciated...
(2) spent the last few hours trying to get pnmath to compile under os-
x 10.5.4...
using gcc version 4.2.1 (Apple Inc. build 5553) as downloaded from
CRAN, xcode 3.0...
...xcode 3.1 installed over top of above after
1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the
order of the arguments. This is an example:
> rpois(n=1,lambda=2)
[1] 3
> rpois(lambda=2,n=1)
[1] 2 0
It obviously uses the first argument as the number of samples to be
drawn, which is wrong.
I used Version 0.49 Beta (April 23, 1997).
Fredrik
1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the
order of the arguments. This is an example:
> rpois(n=1,lambda=2)
[1] 3
> rpois(lambda=2,n=1)
[1] 2 0
It obviously uses the first argument as the number of samples to be
drawn, which is wrong.
I used Version 0.49 Beta (April 23, 1997).
Fredrik