全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
8093 0
2016-03-17
目前stata中已经有相对成熟的模块(mestreg )构建多水平COX回归模型,help mestreg 可以获得相应的示例,当然也可以参考STATA公司比较官方的示例,唯一的不足是:不能像melogit模块构建的多水平logistic回归模型之后采用estat icc 来估计层内相关系数

此外,R中的coxph和frailtypack构建的 frailty models类似于多水平的随机截距模型(random intercept model),而coxme程序包(https://cran.r-project.org/web/packages/coxme/index.html)构建的则是一般意义上的COX混合效应模型,这种模型似乎并不能等价于多水平COX模型(详细可以参考:http://www.stata.com/meeting/uk13/abstracts/materials/uk13_crowther.pdf;)。

如果哪位了解R中构建明确的多水平COX模型,欢迎交流。


以下是stata中mestreg的相对官方的示例:
来源:http://www.stata.com/new-in-stata/multilevel-survival-models/
What's this about?

In multilevel data, we have subjects that can be divided into groups. These may be patients treated at the same hospital, cars manufactured at the same plant, students attending the same school, and so on. If, in these examples, we believe that unobserved characteristics of the hospital, plant, or school may affect the outcome, we can use one of Stata's specialized commands for multilevel mixed-effects models to include group-level random effects in our model. These commands fit models for continuous, binary, ordinal, and count outcomes. For more information, see the Multilevel Mixed-Effects Reference Manual.

Stata also has a suite of features for analyzing survival-time data with outcomes such as length of hospital stays, time to remission for a particular type of cancer, or length of time living in a city. These commands allow us to summarize, graph, and model this type of data. See the Survival Analysis Reference Manual for details.

mestreg allows us to combine multilevel modeling with the parametric analysis of survival-time outcomes.

Let's see it work

Suppose we are interested in modeling the effects of laparoscopic surgery and age on length of hospital stay for adult patients with appendicitis. We believe that doctors affect the length of a patient's stay, so we include a random effect for doctor.

Before we fit the model, we use stset to specify that we have survival-time data. Here, los represents the patient's length of stay in hours. We observe the length of stay for all patients; there is no censoring. Therefore, we simply identify our survival-time variable by typing

. stset los

We fit a Weibull model for length of stay:

cox-1.jpg

Remember that "failure" is the happy event of departing the hospital. With a hazard ratio greater than 1, laparoscopic surgery is associated with shorter hospital stays. Increased age is associated with longer hospital stays. We also see a large variation across doctors that might have contaminated our results had we not taken them into account.

We can plot the marginal survivor function for surgery method:

800.png

After about two days (48 hours), the marginal probability of remaining in the hospital begins to decrease quickly for laparoscopic surgery patients. Those having more invasive surgery can expect to remain in the hospital longer.

We could fit a similar model using streg with shared frailties, but streg assumes the frailties follow a gamma distribution. mestreg makes the often more plausible assumption that random effects are normally distributed, meaning frailties are lognormal. mestreg also lets us extend the types of models that we can fit beyond two-level models with random intercepts.

Suppose we also believe that unobserved hospital characteristics such as discharge procedures may also impact the length of hospital stay. We will assume that doctors practice in only one hospital, so patients are nested within doctors and doctors nested within hospitals. We fit a three-level model with hospital-level and doctor-level random effects.

cox-2.jpg

We draw the same conclusions with regard to age and having laparoscopic surgery as we drew with the previous model. We now find that there is large variation across both doctors and hospitals.

Tell me more

Read more about multilevel mixed-effects parametric survival analysis in the Stata Multilevel Mixed-Effects Reference Manual.

Read the overview from the Stata News.



二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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