I'm trying to make a connected graph where the markers are different sizes, representing different levels of the observation's coefficient of variation (CV). I categorized CV to be 1, 2, or 3 (depending on how large it is), and I would like the connected chart to have the smallest dot if CV=1, and the largest dot of CV=3. I know that one way to customize the connected "dots" is to layer a connected and scatter plot, as I have done here:
twoway (connected vcnr0 year, sort color(black))(scatter vcnr0 year [aweight = cv0], color(black))(connected vcnr1 year, color(blue)) (scatter vcnr1 year [aweight = cv1], color(blue))
However, let's say variable vcnr0 has CVs of 1 and 2, and the variable vcnr1 has CVs of 2 and 3. The above chart does not scale the dots correctly; the size of CV=1 for vcnr0 is the same as CV=2 for vcnr1.
I tried adding an extra "invisible" scatter plot that contained all three categories:
twoway (connected vcnr0 year, sort color(black))(scatter vcnr0 year [aweight = cv0], color(black))(connected vcnr1 year, color(blue)) (scatter vcnr1 year [aweight = cv1], color(blue)) (scatter vcnr0 year [aweight=dots], mstyle(none))
but this did not help. Stata scaled all three weighted scatter plots separately. Can anyone think of a way to write the graphing code and/or organize my data differently to get the scatter plots to scale using ALL the possible weights, not just the weights present in the individual scatter plot?
Thank you!
Lisa
twoway (connected vcnr0 year, sort color(black))(scatter vcnr0 year [aweight = cv0], color(black))(connected vcnr1 year, color(blue)) (scatter vcnr1 year [aweight = cv1], color(blue))
However, let's say variable vcnr0 has CVs of 1 and 2, and the variable vcnr1 has CVs of 2 and 3. The above chart does not scale the dots correctly; the size of CV=1 for vcnr0 is the same as CV=2 for vcnr1.
I tried adding an extra "invisible" scatter plot that contained all three categories:
twoway (connected vcnr0 year, sort color(black))(scatter vcnr0 year [aweight = cv0], color(black))(connected vcnr1 year, color(blue)) (scatter vcnr1 year [aweight = cv1], color(blue)) (scatter vcnr0 year [aweight=dots], mstyle(none))
but this did not help. Stata scaled all three weighted scatter plots separately. Can anyone think of a way to write the graphing code and/or organize my data differently to get the scatter plots to scale using ALL the possible weights, not just the weights present in the individual scatter plot?
Thank you!
Lisa
Comment