[R] Confusion in 'quantile' and getting rolling estimation of sample quantiles

Saji Ren saji.ren at gmail.com
Sun Jan 17 04:08:37 CET 2010


Guys:

1).When I using the 'quantile' function, I get really confused. Here is what
I met:

> x<-zoo(rnorm(500,0,1))
> quantile(x,0.8)
     400 
1.060258 

> c=rnorm(500,0,1)
> quantile(c,0.8)
      80% 
0.9986075

why do the results display different? Is that because of the different type
of the class?

2).And I want to use the 'rollapply' function to compute a rolling
estimation of the sample quantile.
the command i used is below:

> uprange=rollapply(x,width=10,FUN=quantile(x,0.8),align='right')
Here the 'x' is the one generated above in 1).
And the R told me:

"mistakes in match.fun(FUN) : 
  'quantile(x, 0.8)' is not a function, character or symbol"

Can anyone help? Thank you in advanced.


-----
------------------------------------------------------------------
Saji Ren
from Shanghai China
GoldenHeart Investment Group
------------------------------------------------------------------
-- 
View this message in context: http://n4.nabble.com/Confusion-in-quantile-and-getting-rolling-estimation-of-sample-quantiles-tp1015893p1015893.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list