Zero-inflated Poisson models for matched data I have a matched cohort of N=xx cases and the outcomes I'm interested in are counts (with many 0's). I know there exists conditional Poisson models for matched data where the outcomes are counts, but is it possible to run a zero-inflated conditional model in R? Thank you!
 A: For matched data, you can run a standard model as you would with non-matched data except that you must include the matching weights in the estimation and use cluster-robust standard errors with pair membership as the clustering variable. In R, this is straightforward after using MatchIt to perform the matching.
We'll need the following packages: MatchIt for the matching, pscl for the ZIP/ZINB model, and lmtest and sandwich for computing the cluster-robust standard errors and confidence intervals.
library(MatchIt); library(pscl); library(lmtest); library(sandwich)

In this example I'll let A be the binary treatment, X1 and X2 be covariates, and Y be the count outcome (which must be of integer class), and I'll let these exist within the dataset dat. First, we start with the matching, using whatever options you want (here I'll use full matching on the propensity score):
#Full matching on the PS for the ATT
m <- matchit(A ~ X1 + X2, data = dat, method = "full")

Next, we extract the matched dataset from the matchit output object using match.data():
#Extract matched data
md <- match.data(m)

We can now use zeroinfl() from the pscl package to fit a ZIP or ZINB model (I'll use ZINB because that is almost always more appropriate):
#Fit the ZINB model
fit <- zeroinfl(Y ~ A, data = md, weights = weights, dist = "negbin")

Finally, we can use coeftest() and vcovCL() in the lmtest and sandwich packages, respectively, to compute the coefficients and standard errors:
#Coefficients and SEs
coeftest(fit, vcov. = vcovCL, cluster = ~subclass)

This will produce a coefficient table for the count model and the zero-inflation model, which can be interpreted as usual. The count model coefficient is the log of the count ratio and the zero-inflation coefficient is the log of the odds ratio. The standard errors will be correctly adjusted for the matching. To compute confidence intervals on the coefficients scale, you can replace coeftest() with coefci() in the code above. To compute the count ratio and the odds ratio, you would exponentiate the coefficients and confidence intervals, i.e., using
#Coefficients and CIs on the original scale
exp(coef(fit))
exp(coefci(fit, vcov. = vcovCL, cluster = ~subclass))

This procedure is the same as it is for matching with other outcome types. Instructions are detailed in the MatchIt vignette for estimating effects after matching.

Some pointers for those not familiar with R:

*

*If you don't have a package installed, install it using install.packages("pkgname").

*To read in a CSV, use read.csv(); to read in a data object from another data format, e.g., a sas7bdat file from SAS, using functions from the haven package.

*To convert a variable to an integer, use dat$Y <- as.integer(dat$Y). This is necessary for using zeroinfl().

*To get help on any function, use ?fnname, e.g., ?matchit.

