Displaying 20 results from an estimated 30000 matches similar to: "Lowest values in a vector of numbers"
2011 Feb 10
1
How to determine the quantile boundary from an ECDF?
Given a dataset x, the ecdf is ecdf(x). Then I can use ecdf(x)(y) to find
the percentile of y. Given the ecdf is there a way to determine what is the
value of y that is the boundary of let's say 95 percentile? In other words,
is there a function I can call on the ecdf like:
fomeFunc( ecdf( x ), 0.95 )
Which will return the highest value of y, for which ecdf( y ) < 0.95?
The only solution
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
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
2017 Nov 24
2
number to volume weighted distribution
Hi Duncan
I tried Ecdf and/or wtd.quantile from Hmisc and it is working (probably).
Ecdf(x, q=.5)
Ecdf(x, weights=xw,col=2, add=T, q=.5)
wtd.quantile(x)
0% 25% 50% 75% 100%
10 10 10 100 300
wtd.quantile(x, weights=xw, type="i/n")
0% 25% 50% 75% 100%
10.0000 138.8667 192.5778 246.2889 300.0000
But could you please be more specific in this?
>
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
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 Nov 24
0
number to volume weighted distribution
Hi Petr,
I think that Duncan suggests something like this:
x<- c(rep(10,20), rep(300,5), rep(100, 10))
tx <- table(x)
prop.x <- tx / sum(tx)
vx <- as.integer(names(tx))
prop.wx <- tx * vx / sum(tx * vx)
plot(ecdf(x))
plot(vx, cumsum(prop.x), ylim = 0:1)
plot(vx, cumsum(prop.wx), ylim = 0:1)
Best regards,
Thierry
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse
2007 Nov 18
2
Obtaining x-values from ECDF
Dear Group,
I am using the ecdf function as follows:
cawa.cdp <- ecdf(cawaocc$LEFF80)
summary(cawa.cdp)
Empirical CDF: 223 unique values with summary
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.07918 1.35700 1.68600 1.61000 1.91200 2.70000
I can see by the summary that the y-value for the 3rd quartile is 1.912.
How can I obtain the x-value for a specified y-value (e.g., 0.8)?
2004 Oct 26
2
Empirical P Value
I am trying to return the p value for a stat from the ECDF. That is the
index of the first occurrence,
on an ordered vector, of a value either greater than or equal to a given
value.
Ideally I would not have to order the vector beforehand.
Currently I use:
PValue<-function(stat, ECDF){
###Get the length of the ECFD
L<-length(ECDF)
###Loop through the ECDF until the p value is
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 Nov 24
0
number to volume weighted distribution
On 24/11/2017 6:27 AM, PIKAL Petr wrote:
> Dear all
>
> Strictly speaking it is not R question but as you are the most capable persons I know I give it a try.
>
> I am strugling with recalculation of number weighted to volume weighted distribution.
>
> Suppose I have objects (cubes) with size
>
> x<- c(rep(10,20), rep(100, 10), rep(300,5))
> I can get
>
2009 Aug 03
1
Help with Ecdf function
Dear R users,
I'm using Ecdf (Hmisc library) to plot four cdf in a same graphic. In this
graphic I also plot the 0.99 quantile for these cdf. I successfully plot
cdfs using different types of line to distinguish them, but I can't
determine the type of lines showing 0.99 quantile.
Is there a way to assign different line types for quantile lines in Ecdf
plot?
Best regards,
--
Mateus da
2011 Aug 22
2
CDFs
Hello all,
I have two columns of numbers. I would like to do the following:
(1) Plot both cdfs, F1 and F2 on the same graph.
(2) Find smoothed approximations of F1 and F2 lets call them F1hat and F2hat
(3) Find values for F1hat when we substitue a value of x in it.
(4) Find the corresponding densities of the cdfs.
Any ideas?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
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
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
2017 Nov 24
2
number to volume weighted distribution
Dear all
Strictly speaking it is not R question but as you are the most capable persons I know I give it a try.
I am strugling with recalculation of number weighted to volume weighted distribution.
Suppose I have objects (cubes) with size
x<- c(rep(10,20), rep(100, 10), rep(300,5))
I can get
plot(ecdf(x))
or the number weighted average
mean(x)
[1] 77.14286
or volume weighted average
2011 Aug 26
1
Sharp turn in cdf?
x = c(runif(1000, 0,2.5), runif(100, 2.5, 4))
plot(ecdf(x))
You will notice a sharp turn around x = 2.5
How do I get that value of x using R?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2012 Jul 30
2
Thinning Lattice Plot
Is there an easy way to "thin" a lattice plot? I often create plots from
large data sets, and use the "pdf" command to save them to a file, but the
resulting files can be huge, because every point in the underlying dataset
is rendered in the plot, even though it isn't possible to see that much
detail.
For example:
require(Hmisc)
x <- rnorm(1e6)
2006 Feb 21
6
How to sum values across multiple variables using a wildcard?
I have a dataframe called "data" with 5 records (in rows) each of
which has been scored on each of many variables (in columns).
Five of the variables are named var1, var2, var3, var4, var5 using
headers. The other variables are named using other conventions.
I can create a new variable called var6 with the value 15 for each
record with this code:
> var6=var1+var2+var3+var4+var5
2008 Sep 26
2
Does R have an "inverse empirical cumulative distribution" function ?
Dear R Users,
Does R have an "inverse empirical cumulative distribution" function,
something one can use to invert ecdf ?
Thanks in advance,
Tolga
Generally, this communication is for informational purposes only
and it is not intended as an offer or solicitation for the purchase
or sale of any financial instrument or as an official confirmation
of any transaction. In the event you