apply running median for non equidistance daily measurements with potentially several KPI measurements per day Let us say I have daily measurements of a KPI with potential gaps (i.e. no measurements some days) and sometimes several measurements per day. How would one apply the running median (see for example here) in this situation? The intention is to show a trend of the underlying process's KPI. Should one average the values for days with several measurements (e.g. using the median)?
I have used statistical process control charts (SPCCs) and applied box-cox transformations but am not to sure whether the underlying assumption of normality is violated.
I read somewhere that one can use (monthly ?) bootstrapping and then apply SPCCs. Pretty sure I could program this but I lack the "statistical confidence" to judge whether it is worthwhile.
Thanks!
 A: It is hard to gauge how any method would work without even seeing sample data, but the possibilities include

*

*summarizing the last so many values, by a median, or mean, or more generally a trimmed mean

(in this case, consider downweighting according to time elapsed)

*

*summarizing each day, ditto, and just leaving blank days without measurements.

Whatever you do, graphing data and results is essential. (Fine if that is obvious.)
There is no assumption of normality underlying descriptive or exploratory smoothing, although a skewed conditional distribution will affect means more than medians. Trimmed means appear a little non-standard in this territory, but they allow tunable compromise between mean and median.
Box-Cox I personally consider oversold, although not by its original authors (no relation): in the majority of cases, there are two leading possibilities, leaving the data as they come and working on a logarithmic scale.
It is hard to know how you should think about outliers: in a business context, very high or very low values might tell you about past events you know about that aren't part of your decision-making, or they might be important detail you shouldn't discount.
A: Suppose the running median was intended to be the median of 7 values, observed at noon every day of the past week. With irregular observations, one alternative is to take the median of 168 values over all the hours of the past week. The question is then how to fill in the values at the many unobserved hours.
Depending on the KPI and the measurement procedure, you might fill in the value for an unmeasured hour with:

*

*the last measurement before the unmeasured hour

*the first measurement after the unmeasured hour

*a linear interpolation between the above two measurements

*any of the above adjusted for the time of day, e.g. adding the expected difference between noontime and nighttime temperatures to any nighttime temperature observation

*a value from some hourly model fitted to the observed data

If you actually get data once a day at noon as intended, then the first four of these procedures will all give the same value that you would have gotten from the median of the seven daily measurements.
None of this refers to SPCCs, transformations, or an assumption of normality, but it may be enough for a transparent demonstration of trends.
