Hello. I'm working on creating a bubble plot in Stata, and I have a question about something I couldn't solve.
The reference code is as follows:
I want to give weight to the bubble size, as in #1, where the bubble size criterion is the total value, and group it as shown in #2.
In other words, I want to obtain results where, as in #1, the bubble size is divided into 4 groups and the color groups are divided into 2.
Please help me.
Thank you.
The reference code is as follows:
Code:
clear all input x y weight group 1 1 1 1 2 1 10 1 1 2 100 2 2 2 1000 2 end * #1 scatter y x [w=weight], name(A) * #2 twoway (scatter y x if group==1 [w=weight]) /// (scatter y x if group==2 [w=weight]), name(B)
In other words, I want to obtain results where, as in #1, the bubble size is divided into 4 groups and the color groups are divided into 2.
Please help me.
Thank you.
Comment