.-
help for ^stgrby^                                                 (statalist:   )
.-

Graph median and mean survival time by categorical variables
------------------------------------------------------------

	^stgrby^ varlist [weight] [^if^ exp] [^in^ range]^,^ 
			        [ ^med^ian ^p25^ ^p75^ ^mean^ ^r^mean graph_options ]


^stgrby^ is for use with survival-time data; see help ^st^.  You must ^stset^ your
data before using this command; see help ^stset^.

Description
-----------

^stgrby^ graphs the median or mean (optionally restricted mean) of survival
time according to the values of the variables in varlist.  The variables in
varlist may be string or numerical and, if numerical, may be labeled.


Options
-------

^median^ specifies the graph is to be of median survival times. This is the
default.

^p25^ specifies the graph is to be of 25th percentile of survival times. 

^p75^ specifies the graph is to be of 75th percentile of survival times. 

^mean^ specifies the graph is to be of mean survival times. Note that if the
longest follow-up time is censored, the mean survival time is calculated by
exponentially extending the survival curve to zero.

^rmean^ specifies the graph is to be of restricted mean survival times. This
is the mean survival time restricted to the longest follow-up time. Note that
if the longest follow-up time is a failure, the restricted mean survival time
and the mean survival time are equal.

graph_options are any of the options allowed with ^graph, twoway^; see help
    @grtwoway@.


Examples
--------

	. ^stgrby drug size^

	. ^stgrby drug size, mean^

	. ^stgrby drug, rmean^

	. ^stgrby drug, p25^

Also see
--------

On-line:  help for @graph@ @grmeanby@
