# Interpretation of conditional density plots

I would like to know how to correctly interpret conditional density plots. I have inserted two below that I created in R with cdplot.

For example, is the probability of the Result being equal to 1 when Var 1 is 150 approximately 80%?

The dark grey area is that which is the conditional probability of the Result being equal to 1, right?

From the cdplot documentation:

cdplot computes the conditional densities of x given the levels of y weighted by the marginal distribution of y. The densities are derived cumulatively over the levels of y.

How does this accumulation affect how these plots are interpreted?

For example, is the probability of the Result being equal to 1 when Var 1 is 150 approximately 80%?

No, it's the other way around. The probability that Result $=0$ when Var1 $=150$ is approximately 80%. Likewise, the probability that Result $=1$ when Var1 $=150$ is approximately 20%.

The dark grey area is that which is the conditional probability of the Result being equal to 1, right?

The dark shaded area corresponds to Result $=0$; the light shaded area corresponds to Result $=1$.

If you have more than two levels in your Result factor, it will probably be more obvious what is being portrayed. We are just used to looking at density functions so this presentation can be confusing at first.

How does this accumulation affect how these plots are interpreted?

Looking at the source for cdplot(), what I think is going on here is that the smoothed proportions of the results are weighted by the density of the explanatory variable. So, the distributions of the dependent variable are going to be better represented in higher density regions of the explanatory variable.

One way of interpreting that is that where there are regions of the explanatory variable with few points, the conditional distributions will not be as well determined. Where there are regions of the explanatory variable with more points, the conditional distributions will be better determined.