Bookmark and Share

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


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

st: Request help regarding bar graph


From   Michael Stewart <[email protected]>
To   statalist <[email protected]>
Subject   st: Request help regarding bar graph
Date   Fri, 21 Jun 2013 22:37:48 -0400

Hi everyone,

I am posting to get help regarding graph bar ,

I am using Stata 12.1 .

My goal is to display my data as a bar graph with three  bars

1)BAR-1: Total Cost of care for patients(admitted once)  when
ADMISSION_REASON=="SURGICAL"
2)BAR-2: Total Cost of care for patients readmitted(admitted more than
once)) when ADMISSION_REASON=="SURGICAL"
2)BAR-3: Total cost if ADMISSION_REASON=="SURGICAL"

My dataset (with details regarding cost and resource utilization for
thousands of patients) is as follows( in simplified format) .

*************Dataset
Begin********************************************************
ID  HOSPITAL_NAME    ADMISSION_SEQUENCE    ADMISSION_REASON    COST
1    AA                                    1
             MEDICAL            $$
1    AA                                    2
            MEDICAL            $
1    SS                                    3
           SURGICAL        $$$
1    BB                                    4
           MEDICAL            $$
2    AA                                    1
           MEDICAL            $
2    DD                                    2
           SURGICAL        $$$
2    EE                                    3
          MEDICAL            $
2    RR                                    4
           MEDICAL            $$$
2    TT                                     5
            SURGICAL        $$$
3    xx                                     1
            SURGICAL        $$$$
4    RR                                    1
           SURGICAL        $$$$$
*************Dataset End********************************************************

I was able to draw a Bar-1 and Bar-2 graphically display the cost
among patients from two groups without a problem. However adding a
third bar(height is equal to sum of the cost of all surgical
admissions) is proving to be rather difficult.

My code(so far) is as follows :

Step-1: gen readmission variables as follows
bysort ID : gen n=_N
gen readmission=n==1

Step-2: graph bar (sum) COST if
ADMISSION_REASON=="SURGICAL",over(readmission)  blabel(bar)


Can anyone help / advise me please.

Thank you in advance for your consideration.

--
Thank you ,
Yours Sincerely,
Mike.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index