Alternatively,
see rowQuantiles() in the matrixStats package.
/Henrik
On Wed, Oct 6, 2010 at 10:34 PM, Joshua Wiley wrote:
> Hi,
>
> This should do it, for details, see ?apply
>
> a <- matrix(rnorm(1),100,100)
> t(apply(a, 1, quantile, probs = c(.3, .5)))
>
> Basically you apply() the quant
Hi,
This should do it, for details, see ?apply
a <- matrix(rnorm(1),100,100)
t(apply(a, 1, quantile, probs = c(.3, .5)))
Basically you apply() the quantile function to each row (the 1, 2
would indicate columns) in the object 'a'.
HTH,
Josh
On Wed, Oct 6, 2010 at 10:20 PM, Takos wrote:
>
Simple Question
I have 100x100 matrix and I want to calculte each row's 30,50% quantile
ex)
a=matrix(rnorm(1),100,100)
quantile(a[1,],c(0.3,0.5))
quantile(a[2,],c(0.3,0.5))
.
.
.
.
I want get results at once.
so I try quantile(a[1:100,],c(0.3,0.5)) but I can get what I exactly want.
How
Thanks all for your prompt and helpful replies!
Anjan
On Thu, Jan 22, 2009 at 11:52 AM, ANJAN PURKAYASTHA <
anjan.purkayas...@gmail.com> wrote:
> Hi,
> A simple quantile question:
> I need to calculate the 95% and 5% quantiles (aka percentiles) for the
> following data:
> 67.12
> 64.51
> 62.06
>
have a look at the online help file of ?quantile(); check also:
x <- c(67.12, 64.51, 62.06, 55.45, 51.41, 43.78, 10.74, 10.14)
sapply(1:9, function (i) quantile(x, c(0.05, 0.95), type = i))
I hope it helps.
Best,
Dimitris
ANJAN PURKAYASTHA wrote:
Hi,
A simple quantile question:
I need to ca
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of ANJAN PURKAYASTHA
> Sent: Thursday, January 22, 2009 9:52 AM
> To: r-help@r-project.org
> Subject: [R] quantile question
>
> Hi,
> A simple quantile question:
&
Hi,
A simple quantile question:
I need to calculate the 95% and 5% quantiles (aka percentiles) for the
following data:
67.12
64.51
62.06
55.45
51.41
43.78
10.74
10.14
if I use the formula: 95% quantile point= 95 (8+1)/100, I get the 8.55th
point as the 95% quantile. Which does not make too much se
7 matches
Mail list logo