[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: scatter with aweight - consistent sizing across subsets of observations

From   Friedrich Huebler <>
Subject   Re: st: scatter with aweight - consistent sizing across subsets of observations
Date   Thu, 26 Mar 2009 13:26:56 -0400


You can find the solution to your problem in this post:

The example uses overlaid scatterplots but the principle applies to
plots that are drawn separately. Try the code in the post and add one
new command at the end:

. twoway scatter y x [w=weight], by(group) name(D) legend(off)

A more complicated example is shown here:


On Thu, Mar 26, 2009 at 12:22 PM, Dan Weitzenfeld
<> wrote:
> Hi All,
> I am confused as to how exactly Stata determines what will be the
> largest and smallest marker size when using -scatter- with aweights.
> My goal is to create a series of aweighted scatterplots, each one on a
> subset of my data, with the relative marker sizing consistent across
> plots.  That is, if a point in my first graph and a point in my second
> graph are both weighted 100, I'd like them to be the same size,
> regardless of what other points are plotted on each.
> My idea for how to do this is to create two fake datapoints, one equal
> to the universal minimum and one equal to the universal maximum of the
> weights, and to include these fake datapoints in each plot.  Since I
> am copying the graphs into PowerPoint and ungrouping them anyway, I
> can just delete these two fake points.
> Is there any reason this should not work?
> Is there a simpler way?
> Thanks in advance,
> Dan

*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index