[R] queue waiting times comparison

jim holtman jholtman at gmail.com
Thu Aug 18 14:09:11 CEST 2011


I am not sure why you say that "lapply(ml, mean)" shows (incorrectly)
that the second year has a larger average; it is correct for the data:

> lapply(ml, my.func)
$y1
    Count      Mean        SD       Min    Median       90%       95%
     Max       Sum
 18.00000  16.83333  12.42980   4.00000  12.50000  37.20000  41.05000
47.00000 303.00000

$y2
    Count      Mean        SD       Min    Median       90%       95%
     Max       Sum
 15.00000  20.06667  25.27694   4.00000  11.00000  45.80000  70.40000
97.00000 301.00000


You have a larger "outlier" in the second year that causes the mean to
be higher.  The median is lower, but I usually look at the 90th
percentile if I am looking at response time from a system and again
the second year has a higher value.

So exactly why do you not "trust" your data?

On Thu, Aug 18, 2011 at 7:49 AM, Petr PIKAL <petr.pikal at precheza.cz> wrote:
> Hallo all
>
> I try to find a way how to compare set of waiting times during different
> periods. I tried learn something from queueing theory and used also R
> search. There is plenty of ways but I need to find the easiest and quite
> simple.
> Here is a list with actual waiting times.
>
> ml <- structure(list(y1 = c(10, 9, 9, 10, 8, 20, 16, 47, 4, 7, 15,
> 18, 36, 5, 24, 15, 40, 10), y2 = c(97, 10, 26, 11, 11, 10, 5,
> 13, 19, 5, 5, 59, 4, 16, 10)), .Names = c("y1", "y2"))
>
> par(mfrow=c(1,2))
> lapply(ml, hist)
>
> shows that in the first year is more longer waiting times
>
> lapply(ml, mean)
>
> shows (incorrectly) that in the second year there is longer average
> waiting time.
>
> lapply(ml, mean)
>
> gives me completely reversed values.
>
> Can you please give me some hints what to use for "correct" and "simple"
> comparison of  waiting times in two or more periods.
>
> Thank you
> Petr
>
> ______________________________________________
> 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.
>



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?



More information about the R-help mailing list