3
$\begingroup$

I plotted a scatterplot between humidity and temperature (air) in centigrade. I got the following graph;

enter image description here

It is evident that the points fall in discrete columns. This might be because of the rounding of the humidity estimates to one decimal point. To break up these columns, I think some random noise (jitter) could be added to the humidity estimates. I want to know what value of jitter should I use? The new variable (jittered humidity) shall be of the form; humidity + jitter.

$\endgroup$
11
  • 1
    $\begingroup$ What is the problem that you’re trying to solve with jitter? The data being arranged in those vertical lines is not inherently a problem, because it reflects exactly how the data are recorded. $\endgroup$
    – Sycorax
    Commented May 23, 2022 at 17:03
  • $\begingroup$ @Sycorax ; Though it is not inherently a problem, it is probably not how the original data had been collected. The variable has been rounded to 2 decimal points so perhaps adding some random noise will make it look more empirical. $\endgroup$ Commented May 23, 2022 at 17:19
  • 2
    $\begingroup$ @Sycorax I would maintain it is inherently a problem because the discretization potentially (and almost certainly in this case) creates a great deal of overplotting and thereby can cause the visual impression of regions of greater or less density to be deceptive or even horribly incorrect. See stats.stackexchange.com/a/506611/919 for an illustration. $\endgroup$
    – whuber
    Commented May 23, 2022 at 17:32
  • 1
    $\begingroup$ If distance between vertical 'lines' is $w$ then maybe jitter with $\mathsf{Unif}(-w/3,w/3)$ to (mostly) avoid overplotting while still making it clear you're using rounded data. // Similar to suggesting in @whuber's Comment. I have used this and was happy with results. $\endgroup$
    – BruceET
    Commented May 23, 2022 at 21:29
  • 1
    $\begingroup$ In this case, $0.01.$ So, add iid uniform noise supported on $[-0.005,0.005]$ (to the horizontal coordinate) as one of your initial attempts at visualization and go from there. $\endgroup$
    – whuber
    Commented May 24, 2022 at 20:05

1 Answer 1

4
$\begingroup$

There is not a unique way to do this, nor is it easy to formalize the space of possibilities here, so here is one way to set the jitter.

In your case, there appears to be even spacing between columns of points. For a point from a column of points at $x=a$ you could uniformly sample a new position of that point from $[a - \frac{w}{2}, a + \frac{w}{2}]$ where $w$ is the width between columns of points. This should almost-surely protect the order of points along the horizontal axis between columns while spreading out the values.

$\endgroup$

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.