I'm new to using glmer's in the R package LME4. I want to run a repeated measures GLM for my data. The data is looking at a readout of an accelerometer and correlating to behaviour- so the readout has lots of 0's (highly skewed) and non-integers. It looks like the following; enter image description here Histogram of accelerometer readouts

It appears to be a poison or gamma distribution, however, these do not allow for non-integers and zeros, respectively.

I can only seem to run glmer with a gaussian distribution- however I don't think this is appropriate!

I've seen a couple of suggestions about converting the zeros to very small values to allow gamma to run, however we want to be able to look at the relationship between the direct readouts and behaviour so I am hesitant about changing values.

Does anyone have any suggestions?

  • 1
    $\begingroup$ You may want to look into zero inflation models. In your specific case, it sounds like a zero inflated gamma model might be appropriate. There may be something in R that can help you. Your added complication is the repeated measurements... you may need to "roll your own". It might be possible to separately model the incidence of zeros and then the non-zero observations, though this separation would disregard any relationships between the two parts. $\endgroup$ – Stephan Kolassa Jul 15 '20 at 15:13

There are some major misconceptions in the question:

  • Poisson GLMs and distributions absolutely, without shadow of doubt "allow" for 0 and non-integral values. (I think R should deprecate the useless non-integral warning)

  • You can't even guess at the distribution of the response in a GLM by looking at a histogram of the unconditional response

  • Depending on the design/sample size, Gaussian families can be highly robust to non-normal data providing consistent and unbiased inference with reasonable relative efficiency to the parametrically "correct" estimate. It has the added advantage of the effects are mean differences

If were analyzing these data, I would consider a quasipoisson model or GEE. For reasonable sample size and cluster size, why not take advantage of robustness of the experiment to obtain credible, defensible estimates

  • $\begingroup$ I agree with #2 and #3. #1 is questionable/opinion-based. In particular, glmer (which the OP says they want to use) is not reliable with non-integer values. $\endgroup$ – Ben Bolker Jul 15 '20 at 17:29
  • $\begingroup$ @BenBolker Thanks Ben! Where could I look this up? $\endgroup$ – AdamO Jul 15 '20 at 17:30
  • $\begingroup$ @AdamO Thanks for the reply. Can I just ask a couple of things; -When running summary() of Poisson GLM it brings up a never ending list of "non-integer x = 28.363600, non-integer x = 38.545500", alongside a couple of warnings? -You can't seem to run a quasipoisson in lme4- could you recommend a package for doing so? (unable to find). -At what point would you recommend not using a gaussian? I have around 100 repeats/ repeated measure $\endgroup$ – Jessica Harvey-Carroll Nov 15 '20 at 16:16
  • $\begingroup$ @JessicaHarvey-Carroll R is annoying when it reports warnings that aren't real warnings: something that happens often. setting ?warnings to not warn is sometimes necessary... seems that the workhorse for lme4 is fitting poisson GLMs under the hood, hence the repeating warnings. The reason we use a Poisson GLM is that the mean-variance relationship is identity, if that's true the Gaussian model would be biased and inefficient. Perhaps the real question is whether you should be using quasipoisson models or GEE instead. $\endgroup$ – AdamO Nov 17 '20 at 16:12
  • $\begingroup$ @AdamO thanks for reply! have tried turning warnings off and when I do summary() it still brings up a never ending list of "non-integer x = 28.363600, non-integer x = 38.545500". Do you have any suggestions for this? Alternatively how would you run a quasi-poisson, would you suggest the MASS package? Thanks so much $\endgroup$ – Jessica Harvey-Carroll Nov 24 '20 at 11:03

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.