Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Scatter Plots with Weighted Markers-Interpreting the Meaning Behind the Size of the Marker and Standardizing Sizes Across Groups

    Good afternoon.
    I have two questions regarding using weighted markers in state graphics. Below is some simple code that creates two scatter plots and then combines them:

    clear all
    input x y weight group
    1 1 1 1
    2 1 100 1
    1 1 100 2
    2 1 1000 2

    end

    twoway scatter y x if group==1 [w=weight], name(A)
    twoway scatter y x if group==2 [w=weight], name(B)
    graph combine A B



    When this is graphed however, the marker with weight "100" in graph A and graph B are of very different sizes. Is there a way to ensure uniform sizes for identical weights when graphing with weighted markers? Which leads me to a more general question: how does stata size these markers to begin with? The marker with weight "1,000" in graph B is much smaller than the marker with weight "100" in graph A.

    Thank you
    Margot
    Attached Files

  • #2
    Hi Margot,

    Stata shows you that the option you choose for weight led it do assume analytic weights. help weight display what analytic weights are and how they were calculated.

    Additionally, the helpscatter##marker_options says:

    "scatter scales the symbols so that the sizes are a fair representation when the weights represent population weights. If all the weights except one are 1,000 and the exception is 999, the symbols will all be of almost equal size. The weight 999 observation will not be a dot and the weight 1,000 observation giant circles as would be the result if the exception had weight 1."

    Both graphs have such weird point sizes because in group one there is a 100 times difference in weight of observations (1 and 100), while in other group there is only a 10 times difference in weight (100 and 1000).

    Comment

    Working...
    X