Hello!

I have a dateset organized this way:

$ Service: "chrc: 13 cases.“Neurology visit”: 63, “Ginecology visit”: 64, "Gastr…

$ Provider: "chrc: 9 cases.“Provider 1”: 101, “Provider 2”: 104, “Provider 3”: 85, "Provid…

$ Class: “chrc: 4 cases.“A”: 203, “B”: 207, “C”: 214, “D”: 167”

$ N.patients: “nmrc: mean: 342 ± 1 041, median: 47 (IQR: 11 - 214)”

$ W.time: “nmrc: mean: 27.1 ± 29.7, median: 18.4 (IQR: 8.9 - 33)”

$ Year: “fctr: 2 cases.“1”: 413, “2”: 378”

$ Months: “nmrc: 2 cases.“4”: 378, “12”: 413”

Plus variable Context, defined as paste(Service, Provider, Class)

The data show for each context (combinations of Service, Provider and Class) and for two consecutive years (2018, 2019), the number of served patients and the average waiting time. To note, the number of months is different between the years, being 12 months for the first and 4 for the second.

Our aim is to estimate, for determined groups of contexts, which combinations of number of patients and average waiting time for the remaining 8 months of 2019 will predict that the average waiting time for the whole 2019 for the same contexts is below certain thresholds. As an alternative, which is the maximum waiting time per patient allowed to keep the year average below the threshold.

In order to do this I need to simulate the patients for the remaining months of 2019 and their waiting time.

Here’s how I would do it, but I’m totally open to suggestions:

- Jointly model the number of patients and the average waiting time for each context via the formula:

bf(N.patients ~ Service + Provider + Class + Year + Months + (1 | Context), family = poisson()) + bf(W.time ~ Service + Provider + Class + Year + Months + weight(N.patients) + (1 | Context), sigma ~ Service + Provider + Class + Year + Months + weight(N.patients) + (1 | Context), family = lognormal()); is it well specified? I think I need to put some strong priors, because when I tried with just the Poisson part of the model with Cauchy(0, 25) on the coefficients, the convergence was really bad; any suggestions? - Predict the n. of patients and average waiting time for each context in the remaining 8 months of 2019. The outcome of this prediction is the number of patients, isn’t it? Or a distribution of the lambda parameter of the Poisson? I expect an output in which, for every context there is a distribution of patients counts.
- For each simulation I assign a waiting time to the single patients per context using a lognormal distribution with the predicted W.Time and sigma as parameters. What about exponential distribution instead? I guess that step 2 and 3 cannot be done directly together with step 1 in one brms call, isn’t it?
- I prepare a grid in which for each combination of average W.time and N.patients (for the remaining parts of the year) there is the probability that the global waiting time (for the whole year) is below the thresholds. Instead, I don’t really know how to setup the alternative version, in which the whole year compliance with the thresholds is linked to keeping all patient waiting times below a context-specific limit; any suggestions?

The aim is to give a tool to health operators that tells them that if they stay below the values shown in the grids, there is an high chance that at the end of the year the waiting time goals will be achieved. Between the two metods for computi the grid presented in (4), the first is easier to implement, but the second is easier for the health operators to follow.