⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stcox.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 18mar2005}{...}
{cmd:help stcox}{right:dialog:  {bf:{dialog stcox}}{space 15}}
{right:also see:  {help stcox postestimation}}
{hline}

{title:Title}

{p2colset 5 19 21 2}{...}
{p2col :{hi:[ST] stcox} {hline 2}}Fit Cox proportional hazards model{p_end}
{p2colreset}{...}


{title:Syntax}

{p 8 17 2}
{cmd:stcox} [{varlist}] {ifin} [{cmd:,}
{it:options}] 

{synoptset 21 tabbed}{...}
{synopthdr}
{synoptline}
{syntab:Model}
{synopt :{opt esti:mate}}fit model without covariates{p_end}
{synopt :{opth st:rata(varlist:varnames)}}strata ID variables{p_end}
{synopt :{opth sh:ared(varname)}}shared-frailty ID variable{p_end}
{synopt :{opth off:set(varname)}}include {it:varname} in model with coefficient constrained to 1{p_end}
{synopt :{opt bre:slow}}use Breslow method to handle tied failures; the default{p_end}
{synopt :{opt efr:on}}use Efron method to handle tied failures{p_end}
{synopt :{opt exactm}}use exact marginal-likelihood method to handle tied failures{p_end}
{synopt :{opt exactp}}use exact partial-likelihood method to handle tied failures{p_end}

{syntab:Time varying}
{synopt :{opth tvc(varlist)}}time-varying covariates{p_end}
{synopt :{opth texp(exp)}}multiplier for time-varying covariates; default is {cmd:texp(_t)}{p_end}

{syntab:SE/Robust}
{synopt :{opt vce(vcetype)}}{it:vcetype} may be {opt r:obust}, {opt boot:strap}, or {opt jack:knife}{p_end}
{synopt :{opt r:obust}}synonym for {cmd:vce(robust)}{p_end}
{synopt :{opth cl:uster(varname)}}adjust standard errors for intragroup correlation{p_end}
{synopt :{opt noadj:ust}}do not use standard degree-of-freedom adjustment{p_end}

{syntab:Reporting}
{synopt :{opt l:evel(#)}}set confidence level; default is {cmd:level(95)}{p_end}
{synopt :{opt nohr}}report coefficients, not hazard ratios{p_end}
{synopt :{opt nosh:ow}}do not show st setting information{p_end}

{syntab:Reporting 2}
{synopt :{opth mg:ale(newvar)}}create {it:newvar} containing partial martingale residuals{p_end}
{synopt :{opth basec:hazard(newvar)}}create {it:newvar} containing cumulative baseline hazard{p_end}
{synopt :{opth basehc(newvar)}}create {it:newvar} containing baseline hazard contributions{p_end}
{synopt :{opth bases:urv(newvar)}}create {it:newvar} containing baseline survival function{p_end}
{synopt :{opth eff:ects(newvar)}}create {it:newvar} containing estimated log-frailties{p_end}
{synopt :{opth "esr(newvar:newvars)"}}create {it:newvar} containing partial efficient score residuals{p_end}
{synopt :{opth sch:oenfeld(newvar:newvars)}}create {it:newvar} containing Schoenfeld residuals{p_end}
{synopt :{opth sca:ledsch(newvar:newvars)}}create {it:newvar} containing scaled Schoenfeld residuals{p_end}

{syntab:Max options}
{synopt :{it:{help stcox##maximize_options:maximize_options}}}control the maximization process; seldom used{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}
You must {cmd:stset} your data before using {cmd:stcox}; see {helpb stset}.{p_end}
{p 4 6 2}
{cmd:bootstrap}, {cmd:by}, {cmd:jackknife}, {cmd:statsby}, {cmd:stepwise}, and
{cmd:xi} are allowed; see {help prefix}.{p_end}
{p 4 6 2}
Note that {cmd:fweight}s, {cmd:iweight}s, and {cmd:pweight}s may be specified using {cmd:stset}; see {helpb stset}.{p_end}
{p 4 6 2}
See {help stcox postestimation} for features available after estimation.


{title:Description}

{pstd}
{cmd:stcox} fits, via maximum likelihood, proportional hazards models on 
{help st} data.  {cmd:stcox} can be used with single- or multiple-record or 
single- or multiple-failure st data.


{title:Options for stcox}

{dlgtab:Model}

{phang}
{opt estimate} forces the fitting of the null model.  All Stata estimation
commands redisplay results when the command name is typed without arguments.
So does {cmd:stcox}.  What if you wish to fit a Cox model on xb, where xb is 
defined as 0?  Logic says that you would type {cmd:stcox}.  There are no 
explanatory variables, so there is nothing to type following the command.
Unfortunately, {cmd:stcox} looks the save as {cmd:stcox} typed without 
arguments, which is a request to redisplay results.

{pmore}
To fit the null model, type {cmd:stcox, estimate}.

{phang}
{opth strata:(varlist:varnames)} specifies up to five strata variables.
Observations with equal values of the strata variables are assumed to be in 
the same stratum. Stratified estimates (equal coefficients across strata but 
with baseline hazard unique to each stratum) are then obtained.

{phang}
{opth shared(varname)} specifies that a Cox model with shared frailty be 
fitted.  Observations with equal value of {it:varname} are assumed to have
shared (the same) frailty.  Across groups, the frailties are assumed to be
gamma-distributed latent random effects that affect the hazard multiplicatively,
or, equivalently, the logarithm of the frailty enters the linear predictor as 
a random offset.  Think of a shared-frailty model as a Cox model for panel data.
{it:varname} is a variable in the data that identifies the groups.

{pmore}
See {hi:[ST] stcox} for more information on the {cmd:shared()} option.

{phang}
{opth offset(varname)}; see {help estimation options##offset():estimation options}.

{phang}
{opt breslow}, {opt efron}, {opt exactm}, and {opt exactp} specify the
 method for handling tied failures in the calculation of the log partial 
likelihood (and residuals). {opt breslow} is the default.  Note that 
{opt efron} and the exact methods require substantially more computer time than
the default {opt breslow} option. {opt exactm} and {opt exactp} may not be 
specified with {opt robust}, {opt cluster()}, or {opt tvc()}.

{dlgtab: Time varying}

{phang}
{opth tvc(varlist)} specifies those variables that vary continuously with 
respect to time, i.e., time-varying covariates.  This is a convenience option 
used to speed up calculations and to avoid having to {cmd:stsplit} the data 
over many failure times.

{phang}
{opth texp(exp)} is used in conjunction with {opth tvc(varlist)} to specify 
the function of analysis time should be multiplied by the time-varying 
covariates. For example, specifying {cmd:texp(ln(_t))} would cause the 
time-varying covariates to be multiplied by the logarithm of analysis time. If 
{opt tvc(varlist)} is used without {opt texp(exp)}, Stata understands 
that you mean {cmd:texp(_t)}, and thus multiplies the time-varying covariates 
by the analysis time.

{pmore}
See {hi:[ST] stcox} for more information on the {cmd:tvc()} and
{cmd:texp()} options.

{dlgtab: SE/Robust}

{phang}
{opt vce(vcetype)}; see {it:{help vce_option}}.

{phang}
{opt robust}, {opt cluster(varname)}; see
{help estimation options##robust:estimation options}. 

{phang}
{opt noadjust} is for use with {opt robust} or {opt cluster()}. {opt noadjust}
prevents the estimated variance matrix from being multiplied by N/(N-1) or 
g/(g-1), where g is the number of clusters.  The default adjustment is somewhat
arbitrary because it is not always clear how to count observations or clusters.
In such cases, however, the adjustment is likely to be biased toward 1, so we 
would still recommend making it.

{dlgtab: Reporting}

{phang}
{opt level(#)}; see {help estimation options##level():estimation options}.

{phang}
{opt nohr} specifies that coefficients be displayed rather than exponentiated
coefficients or hazard ratios.  This option affects how results are displayed 
and not how they are estimated.  {opt nohr} may be specified at estimation time
or when redisplaying previously estimated results (which you do by typing 
{cmd:stcox} without a variable list).

{phang}
{opt noshow} prevents {cmd:stcox} from showing the key st variables.  This 
option is seldom used since most people type {cmd:stset, show} or 
{cmd:stset, noshow} to set whether they want to see these variables mentioned
at the top of the output of every st command; see {helpb stset}.

{dlgtab: Reporting 2}

{phang}
{opth mgale(newvar)} adds {it:newvar} containing the partial
martingale residuals.  If each observation in your data represents a different
subject (single-record-per-subject data), the partial martingale residuals are
the martingale residuals. 

{pmore}
If you have data with multiple records per subject, the value that {opt mgale()}
stores in each observation is the observation's contribution to the martingale
residual.  Say that you specify {cmd:mgale(pmr)} and that you have previously
{cmd:stset, id(patid)}.  Then {cmd:egen mr = total(pmr), by(patid)} would create
the martingale residuals.

{phang}
{opth basechazard(newvar)} adds {it:newvar} to the data containing the 
estimated cumulative baseline hazard. If {opt strata()} is also specified, 
cumulative baseline estimates for each stratum are provided.

{phang}
{opth basehc(newvar)} adds {it:newvar} to the data containing the estimated 
baseline hazard contributions.  These are used to construct the product-limit 
type estimator for the baseline survival function generated by 
{opt basesurv().  If {opt strata()} is also specified, baseline estimates for 
each stratum are provided.

{phang}
{opth basesurv(newvar)} adds {it:newvar} to the data containing the estimated 
baseline survival function.  Note that, in the null model, this is equivalent 
to the Kaplan-Meier product-limit estimate.  If {opt strata()} is also 
specified, baseline estimates for each stratum are provided.

{phang}
{opth effects(newvar)} is for use with {opt shared()} and creates {it:newvar} 
containing estimates of the log-frailty for each group. The log-frailties
are random group-specific offsets to the linear predictor that measure the 
group effect on the log-relative hazard.

{phang}
{opth esr:(newvar:newvars)} adds {it:newvars} containing the partial
efficient score residuals; see {hi:[ST] stcox}. If each observation in your data
represents a different subject (single-record-per-subject data), the partial
efficient score residuals are the efficient score residuals.

{pmore}
If you have data with multiple records per subject, the values {cmd:esr()} 
stores are each observation's contribution to the score residuals, and these
partial residuals can be summed within {opt id()} to form the subject's 
efficient score residuals.  This could be accomplished as noted under 
{opt mgale()} above.

{pmore}
One efficient score residual variable is created for each regressor in the 
model; the first new variable corresponds to the first regressor, the second
to the second, and so on. 

{phang}
{opth schoenfeld:(newvar:newvars)} adds {it:newvars} containing the Schoenfeld 
residuals. This option may not be used with the {opt exactm} and {opt exactp} 
options.  Schoenfeld residuals are calculated and are reported only at failure 
times.

{pmore}
One Schoenfeld residual variable is created for each regressor in the model; the
first new variable corresponds to the first regressor, the second to the second,
and so on.

{phang}
{opth scaledsch:(newvar:newvars)} adds {it:newvars} containing the scaled 
Schoenfeld residuals.  This option may not be used with the {opt exactm} and 
{opt exactp} options.  Scaled Schoenfeld residuals are calculated and are 
reported only at failure times.

{pmore}
One scaled Schoenfeld residual variable is created for each regressor in the 
model; the first new variable corresponds to the first regressor, the second 
to the second, and so on.

{phang}
{hi:Note:} The easiest way to specify the preceding three options is, for 
example, {opt esr(stub*)}, where {it:stub} is a short name of your choosing.  
Stata then creates variables {it:stub}{cmd:1}, {it:stub}{cmd:2}, etc. 
Alternatively, you may specify each variable name explicitly, in which case 
there must be as many (and no more) variables specified in {cmd:esr()} as 
regressors in the model.

{pmore}
However, be aware that {cmd:stcox} will drop variables from the model due to 
collinearity.  This is a desirable feature.  A side-effect is that the score
residual variable, the Schoenfeld residual variable, and the scaled Schoenfeld
residual variable may not align with the regressors in the way you expect.  Say
that you fit a model by typing

{pmore2}
{cmd:. stcox x1 x2 x3, esr(r1, r2, r3)}

{pmore}
Usually, {opt r1} will contain the residual associated with {opt x1}, {opt r2}
the residual associated with {opt x2}, etc.

{pmore}
Now assume that {opt x2} id dropped due to collinearity.  In that case, {opt r1}
will correspond to {opt x1}, {opt r2} to {opt x3}, {opt r3} will contain 0.  
This happens because, after the collinear variables are omitted, there are only
two variables in the model: {opt x1} and {opt x3}.

{dlgtab:Max options}
 
{phang}
{it:maximize_options}; {opt iter:ate(#)}, [{cmdab:no:}]{opt lo:g}, {opt tr:ace},
{opt tol:erance(#)}, {opt ltol:erance(#)}; see {help maximize}.  These options
are seldom used.
 
 
{title:Examples}
 
{phang}{cmd:. stset failtime died, id(patid)}

{phang}{cmd:. stcox drug age}{p_end}
{phang}{cmd:. stcox drug age, strata(sex)}{p_end}
{phang}{cmd:. stcox drug age, mgale(mg) schoenfeld(sc*) scaledsch(ssc*)}

{phang}{cmd:. stcox drug age, robust}{p_end}
{phang}{cmd:. stcox drug age, strata(sex) robust}{p_end}
{phang}{cmd:. stcox drug age, shared(familyid)}{p_end}

 
{title:Also see}
 
{psee}
Manual:  {bf:[ST] stcox}
 
{psee}
Online:  {help stcox postestimation}; {helpb stcurve};{break}
{help st}, {help stcox diagnostics}, 
{helpb stphplot}, {helpb sts}, {helpb streg}, {helpb stset}{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -