文章:stgenreg: A Stata Package for General Parametric Survival Analysis
命令格式及介绍:
Title
stgenreg -- General parametric survival models
Syntax
stgenreg [if] [in] [, options]
options Description
---------------------------------------------------------------------------
Model
loghazard(string) user-defined log baseline hazard function
hazard(string) user-defined baseline hazard function
bhazard(varname) invokes relative survival models, defining
the expected hazard rate at the time of
event
eq_name(string) specify the components to include in the
linear predictor of each parameter
Reporting
showcomponent display each parsed component specified in
cov#
mataloghazard display the log hazard function passed to
Mata
matakeep do not drop data from Mata after fitting a
model
eform exponentiate coefficients of first ml
equation}
level(#) set confidence level; default is level(95)
Maximization options
nodes(#) number of quadrature nodes
search(string) search option to pass to ml
initmat(matrix_name) matrix of initial values to pass to ml
copy parameters in the initial values matrix are
entered by position
skip any parameters found in initial values
matrix but not in model are skipped
nolog suppress display of log-likelihood iteration
log
maximize_options control the maximization process; seldom
used
---------------------------------------------------------------------------
You must stset your data before using stgenreg; see [ST] stset.
fweights, iweights, and pweights may be specified using stset; [ST] stset.
Factor variables are not currently supported.
2.reshape
有时候需要面板数据,但是数据又不是stata识别的格式,就需要重新调整。
【方法】
这时候reshape还是很方便的。
【例子】
很简明的例子:
reshape long inc, i(id) j(year)
*下面变成上面的命令:
reshape wide inc, i(id) j(year)