From: Dafne on
Hi

I would like to know how to solve the following problem with matlab.
I have a list of numbers that are upper limits (R) and I would like to know the fractio of upper limits with value R less than a given value R0 I know that I cannot use the simple fractio but the kaplan-maier method. I saw there is ecdf in Matlab but I am unable to apply this to my case.

Can you help me thanks Dafne
From: Steven Lord on

"Dafne " <guetta(a)mporzio.astro.it> wrote in message
news:i0ki8k$ggk$1(a)fred.mathworks.com...
> Hi
>
> I would like to know how to solve the following problem with matlab.
> I have a list of numbers that are upper limits (R) and I would like to
> know the fractio of upper limits with value R less than a given value R0 I
> know that I cannot use the simple fractio but the kaplan-maier method. I
> saw there is ecdf in Matlab but I am unable to apply this to my case.
>
> Can you help me thanks Dafne

Are you looking for something like:

R = 1:10;
R0 = 6.5;
fraction = nnz(R > R0)./numel(R)

NNZ returns the number of nonzero elements in the logical expression R > R0
which is the number of values in R that are strictly greater than R0.
Dividing that by NUMEL(R), the total number of elements in R, gives the
fraction.

If you're looking for something else, you're going to need to give a bit
more detail and perhaps a SMALL (say R no more than 20-30 elements) example
of what you're trying to achieve.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com