Statalist


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

st: RE: Bar Graph Lower Bound


From   "Steichen, Thomas J." <SteichT@RJRT.com>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Bar Graph Lower Bound
Date   Mon, 18 May 2009 14:52:20 -0400

Add option -exclude0-.

-----------------------------------
Thomas J. Steichen
steicht@rjrt.com
-----------------------------------

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Peter Goff
Sent: Monday, May 18, 2009 2:41 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: Bar Graph Lower Bound

Hi,

I have, what should be, a fairly simple inquiry. I'm graphing a set of
bar charts show the average results from a survey. The survey is a
likert scale, with values from 1-5. Its misleading to present the
graph from 0-5, but I can't force Stata to restrict the lower bound
the of the graph. I've used the following sub-options:

        ylabel(1(1)5) ///
        yscale(range(1 5)) ///
        ymtick(1(0.5)5, grid)

I have also set "if" statements in my code graphing only if the values
are > 1 (which all are, of course). Zero is always included as a lower
bound. How should I fix this? (The whole graph command is below if
needed)

Best,
~Pete

levelsof prinid, local(prin)
foreach x in `prin' {
        foreach b in core process {
        if "`b'" == "core" {
        local b1 "Core Components"
        }
        if "`b'" == "process" {
        local b1 "Key Processes"
        }
        use questions, replace
        keep if prinid == `x'
        graph bar q_mean q_prin district_mean,  ///
                legend(order (1 "Teacher Mean" 2 "Prinicpal" 3 "District Mean")) ///
                title("Prinicpal `x'") ///
                subtitle("`b1'") ///
                bar(1, fcolor(gs12) ///
                        lcolor(blue) ///
                        lwidth(vthin) ///
                        lpattern(dash_dot)) ///
                bar(2, fcolor(white) ///
                        lcolor(dkgreen) ///
                        lwidth(vthin)) ///
                bar(3, fcolor(gs1) ///
                        lcolor(brown) ///
                        lwidth(vthin)) ///
                ylabel(1(1)5) ///
                yscale(range(1 5)) ///
                ymtick(1(0.5)5, grid)
        graph export "/Users/ptgoff101/Documents/Principal Study/Coaching
Data/`b1'/`b'_`x'.png", replace
        graph save "/Users/ptgoff101/Documents/Principal Study/Coaching Data/
`b1'/`b'_`x'.gph", replace
        }
}
Peter Trabert Goff
PhD student
Department of Leadership, Policy, and Organizations
Vanderbilt University

Peabody #514
230 Appleton Place
Nashville, TN 37203-5721
Tel. 615-415-7844
Fax. 615-322-6596
peter.t.goff@vanderbilt.edu




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

CONFIDENTIALITY  NOTE:  This e-mail message, including any attachment(s), contains information that may be confidential, protected by the attorney-client or other legal privileges, and/or proprietary non-public information. If you are not an intended recipient of this message or an authorized assistant to an intended recipient, please notify the sender by replying to this message and then delete it from your system. Use, dissemination, distribution, or reproduction of this message and/or any of its attachments (if any) by unintended recipients is not authorized and may be unlawful.

*
*   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   |   What's new   |   Site index