全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
3097 0
2013-08-09
1.在stata中作生存分析的命令:
文章: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)


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群