[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Graphing Question

From   "Friedrich Huebler" <>
Subject   Re: st: Graphing Question
Date   Sat, 26 Jul 2008 01:04:50 -0400


-graph pie- supports weights.

. sysuse auto
. sum foreign

    Variable |       Obs        Mean    Std. Dev.       Min        Max
     foreign |        74    .2972973    .4601885          0          1

. graph pie, over(foreign) plabel(_all percent)
. sum foreign [aw=weight]

    Variable |     Obs      Weight        Mean   Std. Dev.       Min        Max
     foreign |      74      223440    .2280254    .422423          0          1

. graph pie [aw=weight], over(foreign) plabel(_all percent)


On Fri, Jul 25, 2008 at 8:59 AM, Data Analytics Corp.
<> wrote:
> Good morning,
> I have, what should be, a simple graphing problem.  I clustered doctors into
> four groups.  I created a table showing the proportion of doctors in each
> group who use a certain drug with their patients.  The proportions are
> simply the weighted means of a binary variable which indicates whether or
> not the drug is prescribed by that doctor.  Now I want to draw a pie chart
> showing those proportions.  I can easily draw a pie that displays
> proportions which are not weighted, but how do I tell Stata to draw the pie
> using the weighted means?  In short, I want the table and pie slices to be
> identical so I can give my client both.
> Incidentally, how do I get the pie slice labels to be outside the pie and
> have the percentages next to the slice label?  It seems that everything goes
> inside the pie and we can either get labels or percentages, but not both.
> Thanks,
> Walt
*   For searches and help try:

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