2
$\begingroup$

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.

enter image description here

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

enter image description here

In the figure below, the mean of q[,2] given q[,1] enter image description here

$\endgroup$
14
  • $\begingroup$ 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. $\endgroup$
    – whuber
    Apr 3, 2014 at 15:58
  • $\begingroup$ 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? $\endgroup$
    – Peter Flom
    Apr 3, 2014 at 16:03
  • $\begingroup$ 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. $\endgroup$
    – Nick Cox
    Apr 3, 2014 at 16:03
  • 1
    $\begingroup$ 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. $\endgroup$
    – Nick Cox
    Apr 4, 2014 at 8:34
  • 1
    $\begingroup$ This approach loses a lot of information. I'm sure you can do better. $\endgroup$
    – whuber
    Apr 8, 2014 at 16:06

1 Answer 1

1
$\begingroup$

It's quite easy to interpret. The horizontal variable is the parameter of the distribution of the vertical variable. I would plot the mean and variance of the vertical variable against the horizontal one to gain more insight.

$\endgroup$
2
  • $\begingroup$ Use of the term "parameter" is loose here. $\endgroup$
    – Nick Cox
    Apr 4, 2014 at 8:36
  • $\begingroup$ 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)$ $\endgroup$
    – Aksakal
    Apr 4, 2014 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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