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

RE: Re: st: catplot problem

From   "Nick Cox" <>
To   <>
Subject   RE: Re: st: catplot problem
Date   Wed, 7 May 2008 15:20:40 +0100

Maarten gives very good advice on this problem, which incidentally is
quite different from any previously aired in this thread. 

I too cannot reproduce the kind of error which seems to be implied here.


Maarten buis

--- Tunga Kantarci <> wrote:
> The problem: Now, I have variable 3, just like variable 1, which
> takes 10 values but for values 2 and 3 there are no observations.
> When I run catplot, 2 has three categories and 3 has three
> categories, etc up to 8. There are no bars for 9 and 10.
> This is the problem: the frequency that should stand for value '4'
> stands for '2' in the graph. The frequency that should stand for
> value '5' stands for '3' in the graph.  Now, if we agree on this -I
> mean if I was able to make my problem clear - this is a deficiency 
> of catplot for me: Catplot simply places the bars to the wrong
> Put differently: if catplot was able to eliminate values 2 and 3 in
> the graph (because there are no observations for them) I would have
> problem. But instead, catplot displays values 2 and 3 on the
> horizontal axis, but the associated bars beling to values 4 and 5.
> Now, I call this deficieny, bug, etc. I don't know what you want to
> call it.

I am not able to reproduce the "bug" you are reporting. Type the
following commands in Stata:

sysuse auto
catplot bar foreign rep78

If I read your example correctly you think that the bar for foreign of
rep78 values 3 4 and 5 would all be incorrectly shifted two places to
the left because there are no foreign cars for values 1 and 2. This is
not the case whith my version of -catplot-.

-- Maarten

Ps. In general I would avoid using the words bug or deficiency, and
instead say that you where expecting command -xyz- to produce 123, but
instead it gave you 456, followed with a question of why this is
happening. Even better would be to give an example using one the
datasets available in Stata (see: -help sysuse-), that way everyone can
immediately see what you are doing and what the results of your
commands are. 

*   For searches and help try:

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