Displaying 20 results from an estimated 3000 matches similar to: "How to determine the quantile boundary from an ECDF?"
2007 Nov 16
1
Extracting x-values from an ecdf
Dear R users,
Quick question on the use of ecdf for producing a cumulative
distribution function.
After having produced a cumulative distribution using ecdf, I would
like to extract the exact x-value for a given percentile. For example
I can ascertain the 1st and 3rd quartile using the summary function:
cawa.cdp <- ecdf(cawaocc$LEFF80)
plot(cawa.cdp, ylab="Fn(x)")
2017 Jun 15
0
"reverse" quantile function
> On Jun 15, 2017, at 12:37 PM, Andras Farkas via R-help <r-help at r-project.org> wrote:
>
> Dear All,
>
> we have:
>
> t<-seq(0,24,1)
> a<-10*exp(-0.05*t)
> b<-10*exp(-0.07*t)
> c<-10*exp(-0.1*t)
> d<-10*exp(-0.03*t)
> z<-data.frame(a,b,c,d)
>
> res<-t(apply(z, 1, quantile, probs=c(0.3)))
>
>
>
> my
2017 Jun 15
2
"reverse" quantile function
Dear All,
we have:
t<-seq(0,24,1)
a<-10*exp(-0.05*t)
b<-10*exp(-0.07*t)
c<-10*exp(-0.1*t)
d<-10*exp(-0.03*t)
z<-data.frame(a,b,c,d)
res<-t(apply(z, 1, quantile, probs=c(0.3)))
my goal is to do a 'reverse" of the function here that produces "res" on a data frame, ie: to get the answer 0.3 back for the percentile location when I have
2017 Jun 15
2
"reverse" quantile function
David,
thanks for the response. In your response the quantile function (if I see correctly) runs on the columns versus I need to run it on the rows, which is an easy fix, but that is not exactly what I had in mind... essentially we can remove t() from my original code to make "res" look like this:
res<-apply(z, 1, quantile, probs=c(0.3))
but after all maybe I did not explain
2005 Jan 07
2
Getting empirical percentiles for data
Dear List,
I have some discrete data and want to calculate the percentiles and the
percentile ranks for each of the unique scores. I can calculate the
percentiles with quantile().
I know that "ecdf" can be used to calculate the empirical cumulative
distribution. However, I don't know how to exact the cumulative
probabilities for each unique element. The requirement is similar
2017 Jun 16
0
"reverse" quantile function
It would depend on which one of the 9 quantile definitions you are using. The discontinuous ones aren't invertible, and the continuous ones won't be either, if there are ties in the data.
This said, it should just be a matter of setting up the inverse of a piecewise linear function. To set ideas, try
x <- rnorm(5)
curve(quantile(x,p), xname="p")
The breakpoints for the
2004 Feb 18
2
Area between CDFs
Dear List:
I am trying to find the area between two ECDFs. I am examining the gap in performance between two groups, males and females on a student achievement test in math, which is a continuous metric.
I start by creating a subset of the dataframe
male<-subset(datafile, female="Male")
female<-subset(datafile, female="Female")
I then plot the two CDFs via
2011 Dec 23
3
data vector to corresonding percentile ranks
I have a problem where I need to calculate the corresponding cohort
percentile ranks for each of several variables.
Essentially, what I need is a function that will calculate the
distribution-free percentiles from each variable's data vector, returning a
corresponding vector of percentiles:
e.g.:
percentile.my.data<-/function/(my.data)
I tried to make ecdf() perform this task but
2012 Mar 03
3
percentile of a given value: is there a "reverse" quantile function?
Dear all,
I am familiar with obtaining the value corresponding to a chosen
probability via the quantile function.
Now I am facing the opposite problem I have a value an want to know it's
corresponding percentile in the distribution. So is there a function for
this as well?
Thank you for your support in advance, Felix
2011 Oct 16
2
ecdf
Hi,
Newbie here. I read the R for Beginners but i still don't get this.
I have the following data (this is just an example) in a CSV file:
courseid numstudents
101 209
141 13
246 140
263 8
321 10
361 10
364 28
365 25
366 23
367
2010 Sep 07
2
Percentile rank for each element in list
Heeeelp
Given this data
x <- c(1,5,100,300,250,200,550,900,1000)
> quantile(x)
0% 25% 50% 75% 100%
1 100 250 550 1000
When I run the quantile, I can only know the value of the nth
percentile
I want to know what's the percentile position of each items in the
list
Sample
1 = 100% on the list has 1 or more
5 = more than x% on the list has 5 or more
100 = more than x% on the
2012 May 02
1
Two ecdf with log-scales
Hi,
i want to plot empirical cumulative density functions for two variables in
one plot. For better visualizing the differences in the two cumulative curves I'd like to log-scale the axis.
So far I found 3 possible functions to plot ecdf:
1) ecdf() from the package 'stats'. I don't know how to successfully set the log.scales? Combining two plots is not a problem:
plot(ecdf(x1))
2006 Apr 20
2
smooth the ecdf plots
Hi All,
I have codes as follows to get the ecdf plots:
>
day.hos2<-c(6,4,6,6,4,6,5,4,7,5,6,6,8,6,17,9,8,4,6,3,5,8,7,12,5,10,6,4,6
,13,7,6,6,25,4,9,96,6,6,6,6,9,4,5,5,4,10,5,7,6)
>
day.hos3<-c(5,6,7,6,4,5,6,6,6,6,19,7,5,9,8,8,7,5,6,20,40,5,8,7,7,5,6,13,
11,9,4,6,9,16,6,7,6)
> f<-ecdf(day.hos2)
> plot(f,col.p='red',col.h='red')
>
2012 May 26
1
Kolmogorov-Smirnov test and the plot of max distance between two ecdf curves
Hi all,
given this example
#start
a<-c(0,70,50,100,70,650,1300,6900,1780,4930,1120,700,190,940,
760,100,300,36270,5610,249680,1760,4040,164890,17230,75140,1870,22380,5890,2430)
length(a)
b<-c(0,0,10,30,50,440,1000,140,70,90,60,60,20,90,180,30,90,
3220,490,20790,290,740,5350,940,3910,0,640,850,260)
length(b)
out<-ks.test(log10(a+1),log10(b+1))
# max distance D
2010 Apr 30
1
Trouble using Ecdf () from the Hmisc library
Hello:
[Kindly Cc when replying]
The question in a nutshell is this: Is there a more robust alternative
to Ecdf ()?
The details:
I've used Ecdf () _a lot_ over the past few years and I have learned
to live with its warnings. But I am running short on time and patience
now [*] Here is a reproducible example:
> library (Hmisc)
> x <- read.csv ( file =
2011 Jul 16
2
ecdf() to nls() - how to transform data?
Hi,
I am using ecdf-function and want to use the ecdf()-data-points for nls() as
data-parameter.
nls() expects 'list' or 'environment' as a data-type, knots(ecdf(mydata))
gives me 'numeric'.
What should I do now?
Thanks in advance - Jochen
Here is the code:
#################################################
# --- Fit ---
# Gumbel-Dist-Function, cumulative,
2012 Apr 24
2
Function from ecdf to ccdf
Dear all,
I would like to calculate the complementary cumulative distribution function. As it is known, the ccdf is the 1-ecdf(X)==1-F(x). (From ?ecdf help is shown that ecdf returns a function which is the F(x)
I would like to use that function inside my function and after call curve (which accepts function as input). My code looks like that
onVector<-seq(1:100)
2009 Jul 03
3
Color of ecdf plots
Hi.
I have the following two ecdf plots in one graph:
plot(
ecdf(....),
do.points=FALSE,
verticals=TRUE,
main=paste("Ecdf of distances ",DIM,sep=""),
col="red"
);
lines(
ecdf(....),
do.points=FALSE,
verticals=TRUE
);
How do I change the color of the resulting graph? Adding col="red" to either plot or lines results in an error
2011 May 25
3
how to compute the inverse percentile of a given observation w.r.t. a reference distribution
Hi,
can anyone help me to figure out how to compute the percentile of an
individual observation with respect to a reference distribution.
What I mean is. Let's assume I have a vector consisting of 10 numbers
{3,5,8,1,9,5,4,3,5.5,7} and I want figure out what percentile the
number 4.9 corresponds to. I failed to find any reference to such a
function, although I would assume this must
2012 May 04
1
Absolute cumulative curve with ecdf/stepfun?
Hi,
I have two variables ranging both from 0 to 1 (n=500 each).
Now I am interested in plotting them both in one plot (using ggplot2).
So far I used ecdf() (from an example I found with google) to get
values for the cumulatice distribution function which gives a relative
curve. I also want to do the same plot but using absolute cumulative
values instead of relative. Can that be done with ecdf or