Data: An item can be in the state 0 or 1 (binary). Each year, it starts in the state 0 and then changes to state 1. I have data of 4 seasons (2010 -2013). Each year I sampled the (same) individuals at different timesteps (depending on the year 20-25 timesteps during 6 months). The individuals are taken from different groups (same for all 4 seasons). I had 3 treatments and each individual of a group had one of these 3 treatments. Each individual each season has a different time of starting its development. For every timestep and every individual I know the time since it has started its development.

I am interested in the time since development start at which individuals generally swap from state 0 to state 1 and whether this time differs between treatments and between years.

Since shortly after the start of development the individuals are always in the state 0 and a certain time after start of development the individuals are always in state 0, time is in many cases a perfect predictor and leads to separation in the data.

Since I am sampling the same individuals over time, I need to exactly reproduce the nested structure of my data in a random term of my model in order to avoid pseudoreplication.

In R, I can deal with the pseudoreplication if I use a logistic model with a random structure: (YEAR | TIMESTEP/GROUP/INDIVIDUAL) and a fixed structure (TREATMENT * TIME * YEAR). Due to the separation in the data, such a model will not convert.

I can deal with the separation in the data by using models which implement bias-reduction (e.g. Firth) as for example brglm or logistf. In these models I will have to treat everything as fixed effect and I will have the problem of pseudoreplication. With so many datapoints, all the model parameters will turn out to significantly influence the state Y (0/1).

Do you know of any way to analyse such data? Are there any R packages that deal with separation and at the same time include random effects? Or is there any (better) way to analyse such data? Or any other way I can avoid pseudoreplication?

I am glad for any input.

  • 1
    $\begingroup$ Regularization although developed without a Bayesian basis has Bayesian connections. Checkout the blme package which will permit you to fit the standard lme4 models as Bayesian models. It should help deal with the separation issues you're experiencing. $\endgroup$ – Heteroskedastic Jim Nov 20 '18 at 12:44
  • $\begingroup$ Thank you! I have started looking into the blme package and it looks promising. I am completely new to bayesian though. How would I be choosing an appropriate prior? Do you have a recommendation? $\endgroup$ – mela Nov 20 '18 at 15:45
  • $\begingroup$ try the defaults for starters. I don't know what the available options are in blme but you could also try normal priors. There's a paper by Andrew Gelman that uses Cauchy priors for this purpose in the non multilevel setting. If you search regularization separation and Gelman, you'll find it. There's work recommending log-F priors too by Sander Greenland. It's more recent. $\endgroup$ – Heteroskedastic Jim Nov 22 '18 at 4:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.