# Hypothesis testing on zero-inflated continuous data

I've got a large continuous dataset with lots of zeros (~95%) and I need to find the best way to test whether certain subsets of it are "interesting", ie don't seem to be drawn from the same distribution as the rest. Zero inflation comes from the fact that each data point is based a count measurement with both true and sampling zeros, but the result is continuous as it takes into account some other parameters weighted by the count (and so if the count is zero, the result is also zero).

What would be the best way to do this? I have a feeling that Wilcoxon and even brute-force permutation tests are inadequate as they get skewed by these zeros. Focussing on non-zero measurements also removes true zeros that are extremely important. Zero-inflated models for count data are well-developed, but unsuitable for my case.

I considered fitting a Tweedie distribution to the data and then fitting a glm on response=f(subset_label). Theoretically, this seems feasible, but I'm wondering whether (a) this is overkill and (b) would still implicitly assume that all zeros are sample zeros, ie would be biased in the same way (at best) as a permutation?

Intuitively, it sounds like have some kind of hierarchical design that combines a binomial statistic based on the proportion of zeros and, say, a Wilcoxon statistic computed on non-zero values (or, better still, non-zero values supplemented with a fraction of zeros based on some prior). Sounds like a Bayesian network...

Hopefully I'm not the first one having this problem, so would be very grateful if you could point me to suitable existing techniques...

Many thanks!

-
 Update. So far, I've found this paper addressing a problem similar to mine: maths.otago.ac.nz/home/downloads/david_fletcher/… – a11msp Mar 29 '11 at 16:12 I'm wondering whether this extremely simplified approximation would make sense, given that zeros form the absolute majority: 1) find the proportion of zeros in each subset. 2) assume that in the subset with the smallest number of zeros all zeros are true. 3) from each subset, remove the proportion of zeros equal to the proportion of zeros in the most "zero-rich" dataset. 4) run standard non-parametric stats on this modified dataset. – a11msp Mar 29 '11 at 17:10

@msp, I think you are looking at a two stage model in that attachment (I did not have time to read it), but zero inflated continuous data is the type I work with a lot. To fit a parametric model to this data (to allow hypothesis tests) you can fit a two stage but then you have two models (Y is the target and X are covariates): P(Y=0 |X) and P(Y|X;Y>0). You have to use simulation to "bring" these together. Gelmans book (and the arm package in R) shows this process for this exact model (using logistic regression and ordinary linear regression with a log link).

The other option I have seen and like better is to fit a zero inflated gamma regression, which is the same as above (but gamma as the error instead of guassian) and you can bring them together for hypothesis tests on P(Y|X). I dont know how to do this in R, but you can in SAS NLMIXED. See this post, it works well.

-
@B_Miner, thanks very much for your answer, sorry don't have enough rating to vote you up... I'll have a look at the links! My only worry about conditional models is that they postulate that zeros cannot belong to the second (continuous) component, am I right? Does my setting not feel a bit more like a mixture model? What do you think? – a11msp Mar 29 '11 at 17:42
I've now replicated the two-stage approach proposed in the Gelman book. If subset_factor (with 25 levels) serves as subset label, the first step is fit1=glm(response~subset_factor, family=binomial); and the second step is fit2=lm(response~subset_factor, subset=response>0). I can then run simulations as they describe to obtain the distribution of fitted response values for each factor level. However, I'm still unsure how to translate this to what I need, which is (a) the probability that coefficients aren't zero and (b) significance of difference between coefficients at different factor levels. – a11msp Mar 29 '11 at 19:02
The two stage approach (Gelman method of two seperate models) assumes two populations, those at zero and those above. – B_Miner Mar 29 '11 at 19:25
...so would it be appropriate to simply say that if the impact of some factor level is significant (and significantly different from that of some other factor level) in either of the two models in Gelman's method then it's significant overall? – a11msp Mar 29 '11 at 19:28
Yes, the two stage approach (Gelman method of two seperate models) assumes two populations, those at zero and those > 0. Regarding the hypothesis tests, can you frame them in terms of the predicted values for varying levels of the inputs and construct empirical confidence intervals related to the simulations for each? For hypothesis tests for the coefficient != 0, you need to test this seperately for both models. – B_Miner Mar 29 '11 at 19:32

@B_Miner Regarding the R-code for the combined approach (zero inflated gamma regression) you can use compound poisson models with the tweedie and the statmod package. Find the distribution parameter p (out$xi.max) with tweedie.profile and then fit the GLM with family=tweedie, e.g. summary(glm( y ~ x, family=tweedie(var.power=out$xi.max, link.power=0)))

-