I'm having some trouble finding the right way to make this graph. I want to combine two bar charts and have them overlayed on each other, with the more general categorical variable overlaying the more specific one.
Here are the variables I am working with
Using
I get a graph that looks like this:
Then using this
I get a graph that looks like this:

I've tried using
but that leaves the empty values on the valid and invalid sides like this:
I've also tried
but the results are similarly ineffective.
Here are the variables I am working with
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input double Q_RecaptchaScore float(RecaptchaFails recaptchafails)
.4000000059604645 1 1
.8999999761581421 0 0
.8999999761581421 0 0
.8999999761581421 0 0
.800000011920929 0 0
. . .
.699999988079071 0 0
.8999999761581421 0 0
.10000000149011612 1 1
.800000011920929 0 0
.8999999761581421 0 0
.8999999761581421 0 0
.800000011920929 0 0
1 0 0
.800000011920929 0 0
. . .
.800000011920929 0 0
. . .
.8999999761581421 0 0
.8999999761581421 0 0
.800000011920929 0 0
.30000001192092896 1 1
.8999999761581421 0 0
.699999988079071 0 0
.4000000059604645 1 1
.800000011920929 0 0
.8999999761581421 0 0
.800000011920929 0 0
.4000000059604645 1 1
.30000001192092896 1 1
.8999999761581421 0 0
1 0 0
.800000011920929 0 0
.8999999761581421 0 0
.6000000238418579 0 0
.800000011920929 0 0
.10000000149011612 1 1
.699999988079071 0 0
.699999988079071 0 0
.8999999761581421 0 0
1 0 0
. . .
.8999999761581421 0 0
.4000000059604645 1 1
.800000011920929 0 0
.8999999761581421 0 0
.800000011920929 0 0
.4000000059604645 1 1
. . .
.800000011920929 0 0
. . .
.8999999761581421 0 0
.800000011920929 0 0
.800000011920929 0 0
.10000000149011612 1 1
. . .
.10000000149011612 1 1
. . .
.8999999761581421 0 0
.8999999761581421 0 0
.699999988079071 0 0
.30000001192092896 1 1
.8999999761581421 0 0
.8999999761581421 0 0
.800000011920929 0 0
.30000001192092896 1 1
.800000011920929 0 0
1 0 0
.800000011920929 0 0
.4000000059604645 1 1
.800000011920929 0 0
.8999999761581421 0 0
.10000000149011612 1 1
.4000000059604645 1 1
.699999988079071 0 0
1 0 0
. . .
. . .
.699999988079071 0 0
.800000011920929 0 0
. . .
.800000011920929 0 0
.8999999761581421 0 0
.8999999761581421 0 0
.8999999761581421 0 0
.800000011920929 0 0
.8999999761581421 0 0
.8999999761581421 0 0
.30000001192092896 1 1
.8999999761581421 0 0
.800000011920929 0 0
.800000011920929 0 0
.800000011920929 0 0
.4000000059604645 1 1
.8999999761581421 0 0
. . .
.8999999761581421 0 0
.800000011920929 0 0
.800000011920929 0 0
.800000011920929 0 0
end
label values RecaptchaFails FraudScoreFails
label def FraudScoreFails 0 "Valid", modify
label def FraudScoreFails 1 "Invalid", modify
Code:
graph bar (count) Q_RecaptchaScore, over(RecaptchaFails, label)
Code:
graph bar (count), over(Q_RecaptchaScore, label)
I've tried using
Code:
graph bar (count), over(Q_RecaptchaScore, gap(*0)) over(RecaptchaFails, gap(*0)) stack
Code:
graph bar (count), over(recaptchafails, gap(*0)) over(Q_RecaptchaScore, gap(*0)) over(RecaptchaFails, gap(*0)) //and graph bar (count), over(Q_RecaptchaScore, gap(*0)) over(RecaptchaFails, gap(*0)) over(recaptchafails, gap(*0)) //and graph bar (count), over(Q_RecaptchaScore) over(recaptchafails, gap(*0)) by(RecaptchaFails) asyvars

Comment