[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: Drawing a sample that maintains means
> I want to plot weight by age for two groups on the same
> graph. One of the
> groups has about 18,000 observations, which really crowds
> the graph. The
> other has about 700 observations. So I would like to draw
> a sample that
> will plot well, but maintain the mean weight (to one
> decimal place) at each
> of six exams for each of the two groups. Is there a good
> way to draw a
> sample this specific?
One decimal place? I guess you are using not
standard scientific units, but U.S. units, and that
these data are for people, so weights are in pounds.
If ages are in years, then perhaps this reduces to
. egen tag = tag(group age weight)
. separate weight, by(group)
. gra weight? age if tag, sy(op)
That is, only one observation from
each subset with the same values of age, group
and year is tagged, and therefore graphed.
If your observations are less granular
nearest pound and age last birthday,
then this may not help.
* For searches and help try: