I have some data in which each row is a context, each with a number of people and an average quantity (ie. wating time), recorded in two different years, in twelve months of observation for year one and in 4 months for year 2. I want to simulate the number of people in each context and the waiting time for each person.
I thought about this procedure:
- estimate the number of persons for each context with a mixed effect Poisson model with a random intercept at the context level and the year and the months of observation as covariates;
- estimate the average waiting time per context, this time with a lognormal regression with the same parameters of (1);
- simulate the number of persons I would see for each context in the remaining months of year 2, using the Poisson distribution estimated in (1) and assign them a waiting time according to the context-specific distribution estimated in (2).
- use this model to decide how low should be the average of some contexts in order to have global waiting time below a certain threshold.
The problem is that I don’t know how to achieve step 3 in Greta.