Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

RE: st: CATPLOT to compare


From   Lucie Vlach <Lucie.Vlach@albertahealthservices.ca>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: CATPLOT to compare
Date   Tue, 20 Mar 2012 11:39:46 -0600

Thank you very much, Nick!
The graphs look great! Really appreciate this.
Also, my apologies for not using  -catplot-  to indicate Stata syntax. Makes sense.
Thanks again!

Lucie

________________________________________
From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox [njcoxstata@gmail.com]
Sent: March 20, 2012 2:32 AM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: CATPLOT to compare

What I think you want can be done. Study this code and adapt to your
circumstances.

sysuse auto, clear
catplot rep78 foreign, percent(rep78)  blabel(bar)

preserve
local Np1 = _N + 1
expand 2
replace rep78 = 6 in `Np1'/L
gen extra = _n >= `Np1'
label def rep78 6 "Total"
label val rep78 rep78
catplot rep78 foreign, percent(rep78 extra) blabel(bar)
restore

On some details:

1. The reference "Cox 2004" is ambiguous even with a guess as to who
and where. References should not have to be guessed: on Statalist we
ask for the same standards of referencing as you would want to
encounter in scholarly or scientific work.

2. The syntax you quote could only work with -catplot- 2.0.0 or later
(SSC 2010).

3. On the form -catplot- rather than CATPLOT please see

http://www.stata.com/statalist/archive/2012-03/msg00513.html

Nick

On Tue, Mar 20, 2012 at 3:03 AM, Lucie Vlach
<Lucie.Vlach@albertahealthservices.ca> wrote:

> This seems like an easy task, but I cannot figure this out.
> I need to set up a bar graph sharing the same axis (if possible), showing a comparison of patient gender breakdown (in percent) for one doctor vs. whole clinic (in percent).
>
> Using Nick Cox’s catplot (Cox 2004), I am trying this:
> catplot doctor gender, percent(doctor)  blabel(bar)
> (doctor is float  %9.0g  and gender is  float  %9.0g)
> Stata IC 11.2 ver.
>
> But I cannot seem to be able to add the clinic overall gender percentage side by side with the individual doctor stats. For example, I need MALE showing 48.45% for doc, next to 38.07% for overall clinic and then FEMALE showing the rest respectively.
> Do I need to create an additional variable to make this work?

*
*   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/

This message and any attached documents are only for the use of the intended recipient(s), are confidential and may contain privileged information. Any unauthorized review, use, retransmission, or other disclosure is strictly prohibited. If you have received this message in error, please notify the sender immediately, and then delete the original message. Thank you.

*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index