0
$\begingroup$

I have data set up in the standard difference in difference format. Each subject has two observations, one for pre and one for post intervention. The outcome variable is total number of ER visits. The is a study and control group. Therefore, the DID is to test the difference between the study periods and control periods.

The outcome variable is an overdispersed count variable in the form of a negative binomial distribution.

I have ran several iterations of the DID model In SAS using PROC GLIMMIX and PROC GENMOD but the model fit is terrible, whereby the residuals are extremely heteroskedastic.

I’m looking for guidance on how to conduct a ZIP-NEGBIN DID regression in SAS or R.

Is the most appropriate approach to perform the ZIP-NEGBIN regression for each time period and compare the coefficients between and within groups for each period?

Any other recommendations to get to an adequate process to handle this data would be awesome. Many thanks.

$\endgroup$
2
$\begingroup$

It was not clear from your description if you have any missing data, i.e., some subjects who have only one of the two measurements (either pre or post), and you only consider subjects with both measurements. In this case, working with differences and only the subjects with two measurements will only be valid under the missing completely at random assumption (something that seldom holds in practice), and less efficient because you're using less data.

Hence, another approach, and instead of working with differences would be to consider both measurements as outcomes and fit a zero-inflated or hurdle negative binomial model. With mixed models, you use all subjects (also the ones with one measurement), and the resulting estimates and standard errors will also be valid under the more plausible missing at random assumption. These models are available in R, for example in the GLMMadaptive package; for specific examples, check the vignette Zero-Inflated and Two-Part Mixed Effects Models.

$\endgroup$
1
$\begingroup$

Firstly, if a negative binomial model is appropriate, then a model for the second time period with the count the preceding period (ideally log-transformed due to the link function - for 0 counts you may have to e.g. add 0.5) as a model covariate should be fine. This may get quite close to capturing the relationship between preceding and new counts. This model can also be applied when you only look at people with a minimum number of events in the first period. For implementation you can e.g. use proc genmod in SAS or glm.nb from the MASS package in R (just remember that you probably want to correct the standard errors that tend to be too small, confidence intervals and p-values you get from glm.nb). Another option - which is problematic, if you select patients based on the count in the first period, but may be preferable if you did not - is to exploit that a negative binomial model is a Poisson model with a random patient effect. So, you can use a random effects Poisson model with a subject-specific random effect capturing that outcomes for the same patient are correlated across time periods. If you want to stick as closely as possible to a negative binomial model, then a gamma-distributed random effect on the rate would be what you want (e.g. using proc countreg in SAS with the errorcomp=random option in the model statement and the groupid= option in the proc countreg statement). However, you can achieve something very similar with a normally distributed random effect on the log-rate (there is much more software that can do this without much effort, e.g. proc glimmix in SAS or the glmer function in the lme4 package in R).

When evaluating whether a negative binomial model is suitable, remember that standard residuals are not what you want to look at, but look up the recommendations for model residuals for negative binomial models. It also useful to look at the estimated expected proportion with each count from a negative binomial model to to compare it to the data - especially when you are considering whether you need a zero-inflated model.

Secondly, if there is an excess of zero counts and you need a zero-inflated model. Then the same options as above can work. Fitting a zero-inflated model with a covariate is pretty straightforward and most software can do this. A zero-inflated random effects model is a bit trickier, for example you have to decide how the regression coefficients affect the probability of a zero. There seem to be a number of R packages that offer such a model, if you google for “R zero-inflated random effects”, but I do not have any experience with any of them. In SAS I would probably implement this in proc nlmixed by using a normally distributed random effect on the log-event rate, writing out the intended log-likelihood for a zero-inflated Poisson model and using the model ~ general(ll); statement (where ll is the log-likelihood you have defined).

$\endgroup$
1
  • $\begingroup$ There isn’t missing data for each subject. We have them tracked over time continuously since the source is claims data. DID regression aside. Does this approach make sense in evaluating if there are difference pre-post between groups - (1) Perform a Wilcoxon sign rank test on each subject pre-pre to assess if there is a difference within groups by time period, then (2) take the differences of each group and run a Wilcoxon rank sum test to assess if there exists a difference between pre-post changes in groups? $\endgroup$ – Ronald Sanchez Oct 5 '18 at 3:49

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.