 Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# RE: st: 3D bar plot

 From Nick Cox To "'statalist@hsphsun2.harvard.edu'" Subject RE: st: 3D bar plot Date Wed, 18 Jan 2012 10:53:44 +0000

```While I am naturally happy that Maarten thinks my -tabplot- worth recommending, and it is as far as I know the closest to what is being asked for, on a second take I am a bit puzzled by the original question.

Panel means and standard deviations are in general real-valued and I would not expect many exact ties. So, a scatter plot of panel SD and panel mean sounds more natural. (Jittering is available if there are ties.) Some people are keen on bubble plots.

If the number of panels is enormous, -tabplot- might well look like a mess even after some binning, and some kind of heat map may be more advisable.

Nick
n.j.cox@durham.ac.uk

Maarten Buis

On Wed, Jan 18, 2012 at 7:33 AM, Ning Li <ning.li@unimelb.edu.au> wrote:
> What is the command for drawing a 3D bar plot? by 3D bar plot it is meant -
>
> Suppose our data set is {(x,y,z)}={(8.3, 2.3, 2), (9.2, 1.8, 4), (7.1, 0.9, 5)}
> For each point in the (x,y) plate, a vertical bar with height that equals the corresponding z value is drawn. ie., in the position (x,y)=(8.3,2.3), a vertical bar of length 2 is presented, ....
>
> When x and y represent, respectively, within-person mean and within-person standard deviation, and z the frequency of the corresponding pattern, this plot should give a graphic summary of the panel data.

I would look at Nick Cox's -tabplot- (see: -ssc descr tabplot-). It is
not 3D, but I think it does what you want to do. Here is an example:

*---------- begin example ---------------
webuse union, clear
xtset idcode year
bys id: egen m = mean(union)
bys id : egen sd = sd(union)
bys id (year) : gen byte mark = _n == 1

// we need some rounding in this dataset
// to get a readable graph
replace m  = round(100*m ,10)
replace sd = round(100*sd,10)

// the graph
tabplot m sd if mark
*----------- end example ----------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```