Skip to content

Calculating percentiles for multiple dates

5 messages · guzzom, Rui Barradas, arun

#
Sorry, I've sent this only to the op, forgetting to cc the list.

Hello,

Percentile of what? You probably have a dataset with dates and a 
variable, right? What is the nature of that variable?
Post a data example:

dput(head(myData), 20)  # or 30

Copy the output of that command and paste it in  a post. Tip: it starts 
with structure(...etc ...
Paste it all, for us to see what your data looks like.

Hope this helps,

Rui Barradas

Em 30-07-2012 17:35, guzzom escreveu:
#
Hi,

If you look at the output from the given data, the lwr and upr is constant for a particular date.? So, I guess you can use that value as the percentile.? I assume that your statement of grouping all of one date together so as to average out the observations.? In that case, there will be only a single observation per date.
A.K.? 
?? 

----- Original Message -----
From: guzzom <mattguzzo12 at gmail.com>
To: r-help at r-project.org
Cc: 
Sent: Monday, July 30, 2012 12:35 PM
Subject: Re: [R] Calculating percentiles for multiple dates

I was hoping to calculate the percentile for each date. So group all of one
date together, calculating the value of the 2.5 and 97.5 percentile.



--
View this message in context: http://r.789695.n4.nabble.com/Calculating-percentiles-for-multiple-dates-tp4638183p4638378.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
#
Hello,

Sorry for my earlier post, they show the problem of not providing 
context. Fortunatelly, arun's post made me realize there was some data 
posted somwhere after all. So, try this:

aggregate(DEPTH ~ LOG_DATE, data = dat1, quantile, probs = c(0.025, 0.975))
   LOG_DATE DEPTH.2.5% DEPTH.97.5%
1    37757   0.635225    5.042800
2    37758   0.299250    2.870000


Hope this helps,

Rui Barradas

Em 30-07-2012 17:35, guzzom escreveu: