Statalist The Stata Listserver


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

Re: st: plotting model results (re-posted, due to email formatproblem)


From   Michael McCulloch <[email protected]>
To   [email protected]
Subject   Re: st: plotting model results (re-posted, due to email formatproblem)
Date   Fri, 1 Jun 2007 09:13:38 -0700

Thank you Scott! Works just fine.
Michael

clear
input     idnum   str7  idstr   estimate
       6   "Smoking"       0.65
       3       "Age"       0.65
       7   "Surgery"      0.68
       2      "Full"       0.68
       5      "Race"       0.68
       8       "Rad"       0.68
       9     "Chemo"       0.68
       4       "Sex"       0.75
       1     "Unadj"       0.77
end
gen id2 = idn
replace id2 = 0 if ids == "Full"
replace id2 = idn -2

twoway scatter estimate id2 if ids != "Unadj" , ///
mlabel(ids) mlabposition(12) sort ///
xlabel(0 "2"  1 "3" 2 "4" 3 "5" ///
4 "6"  5 "7"  6 "8" 7 "9") xtitle(ID Number)


Scott


On 6/1/07, Michael McCulloch <[email protected]> wrote:

I have the following data points:
    idnum     idstr   estimate
        6   Smoking       0.65
        3       Age       0.65
        7   Surgery       0.68
        2      Full       0.68
        5      Race       0.68
        8       Rad       0.68
        9     Chemo       0.68
        4       Sex       0.75
        1     Unadj       0.77

My goal is to plot the results with the HR from the "Full" model on
the far left, with the remaining HRs off to the right in ascending
order. The following code gets me close to what I want.

       . sort estimate
       . twoway scatter estimate idnum if parmseq==1 & ids!="Unadj",
mlabel(ids) mlabposition(12)

Can anybody suggest how I can force "Full" to the far left, while
having the remaining data points to the right, in ascending sort
order?

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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