Michael
The placement() suboption's arguments (ne, se etc) are relative to the
_point_ you nominate as the #y #x arguments of the main text()
option. In
this case we had text(.05 5...) and the placement was ne , so
the box
was sited to the northeast (above and to the right) of of the point
defined
by y=0.05 and x=5.
If you want the text box elsewhere, you will need to change the #y
and #x
specs.
As far as box size is concerned:
sysuse cancer.dta, clear
stset studytime
drop if drug==3
sts test drug
local chi_P logrank P = `=round(chi2tail(r(df),r(chi2)), .01)'
sts graph, by(drug) risktable text(.05 5 "`chi_P'", place(ne) box
size(small) col(red) width(80) height(40))
... though admittedly more care with the height() and width() option
might
be warranted.
Phil
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Michael
McCulloch
Sent: Friday, 12 February 2010 2:59 PM
To: [email protected]
Subject: Re: sts test: displaying log-rank test of equality within a
Kaplan
Meier graph
Thanks Phillip! This gives me the idea. May I ask:
* regardless of what place option I use: ne, se, nw, sw, etc., they
all put the text box in the lower left corner. I've read -help
compassdirstyle- and
* bexpand also doesn't expand the size of the box.
Michael
On Feb 11, 2010, at 8:05 PM, Philip Ryan wrote:
Michael
I note you wanted a "window". Here is a box instead. I also correct
my
misuse of the return scalars :-(
sysuse cancer.dta, clear
stset studytime
drop if drug==3
sts test drug
local chi_P logrank P = `=round(chi2tail(r(df),r(chi2)), .01)'
sts graph, by(drug) risktable text(.05 5 "`chi_P'", place(ne) box
size(small) col(red))
Philip Ryan
University of Adelaide
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Michael
McCulloch
Sent: Friday, 12 February 2010 1:23 PM
To: Statalist Statalist
Subject: sts test: displaying log-rank test of equality within a
Kaplan
Meier graph
Dear Statalist members,
I'm creating a Kaplan-Meier graph, and also performing the log-rank
test of equality, for example:
sysuse cancer.dta, clear
stset studytime
drop if drug==3
sts graph, by(drug) risktable
sts test drug
My question: is it possible to display the results of the log-rank
test in a small window within the area of the Kaplan-Meier survival
curve?
Best wishes,
Michael McCulloch
Pine Street Foundation
124 Pine Street
San Anselmo, CA 94960-2674
tel: 415-407-1357
fax: 206-338-2391
*
* 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/
*
* 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/
Best wishes,
Michael McCulloch
Pine Street Foundation
124 Pine Street
San Anselmo, CA 94960-2674
tel: 415-407-1357
fax: 206-338-2391
*
* 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/
*
* 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/