# Data transformation for count data with many zeros

I have a count dataset that contains many zeros and a discrete variable that contains many zeros as well. I would like to see graphically which kind of correlation exists between these two variables. When I try in R to plot these two variables (plot(X, Y))) I get something that I'm not able to interpret.

Is there any data transformation that could help me to graphically identify the relation between these two variables?

I add also the histograms for the two variables, mean and sd

In the figure below, the mean of q[,2] given q[,1]

• This plot is inadequate for finding good answers, due to all the overlaps in the points. It does strongly suggest re-plotting the data using a logarithmic vertical scale, though. It also suggests that the second variable ought to be treated as continuous rather than discrete, given it has such a large number of distinct values. What still needs to be shown is how this plot behaves when the second variable is close to zero.
– whuber
Apr 3, 2014 at 15:58
• As a first, easy step, I suggest jittering q[,1]. I also suggest a univariate look at both, but especially q[,2]. Finally, can you tell us what these variables are? Apr 3, 2014 at 16:03
• A transformation is unlikely to help here, but consider plotting distributions as parallel histograms, strip or dot plots (even box plots). Also plot mean and SD of the response. Much depends on whether the zeros are structural (like babies born to men) or sampling zeros (in principle, they could have been positive counts). If you have structural zeros, consider setting them on one side. Apr 3, 2014 at 16:03
• What are needed are the mean and SD of q[,2] given q[,1], not the overall means and SDs. If there is a relationship between your variables, then the mean number of users will vary with size of project. On the face of it (and slightly contrary to @whuber) Poisson regression might be a starting place, but you may have overdispersion too. Apr 4, 2014 at 8:34
• This approach loses a lot of information. I'm sure you can do better.
– whuber
Apr 8, 2014 at 16:06

• yes, it's more like conditional distribution, than a parameter. so if you have a joint $F(x_1,x_2)$ then $F_1(x_1|\theta)=F(x_1,x_2=\theta)$ Apr 4, 2014 at 13:19