Modeling Survival Data Using Frailty Models
chap 2. Some Parametric Methods
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.2 Exponential Distribution . . . . . . . . . . . . . . . . . . . 20
2.3 Weibull Distribution . . . . . . . . . . . . . . . . . . . . . 21
2.4 Extreme Value Distributions . . . . . . . . . . . . . . . . 23
2.5 Lognormal . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.6 Gamma . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.7 Loglogistic . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.8 Maximum Likelihood Estimation . . . . . . . . . . . . . 30
2.9 Parametric Regression Models
chap 6. Estimation Methods for Shared Frailty Models
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . .105
6.2 Inference for the Shared Frailty Model . . . . . . . . . . 106
6.3 The EM Algorithm . . . . . . . . . . . . . . . . . . . . . . .108
6.4 The Gamma Frailty Model . . . . . . . . . . . . . . . . . . . 110
6.5 The Positive Stable Frailty Model . . . . . . . . . . . . . . 111
6.6 The Lognormal Frailty Model . . . . . . . . . . . . . . . . . 113
6.6.1 Application to Seizure Data . . . . . . . . . . . . . . . 113
6.7 Modified EM (MEM) Algorithm for Gamma Frailty Models 114
6.8 Application
然后用最基本的package "survival"
并参考你的模型可能用到的一些functions:
survreg(formula, data, weights, subset,na.action, dist="weibull",....)
survreg.distributions include "weibull", "exponential", "gaussian",
"logistic","lognormal" and "loglogistic"
frailty(x, distribution="gamma", ...)
distribution: either the gamma, gaussian or t distribution may be specified.
frailty.gamma(x, sparse = (nclass >5), theta, df, eps = 1e-05,
method = c("em","aic", "df", "fixed"),...)
outer函数是求外积的。参数为2个,即 X, Y。参数3个是设置 第三个参数 FUNouter(X, Y, FUN = "*", ...)
一般是要3个参数做运算的呀。如果2个参数,默认第三个参数为 * ,即效果一样。
r语言中等于号是用作赋值的功能。R语言最开始设计的时候,是采用箭头(<-)作为赋值符号的,这是从APL语言继承而来的(箭头表示赋值,等号表示判断)。之后的S语言也沿用了这个用法,再之后R语言为了保持和S语言的兼容性保留了这个箭头。直到2001年,R的更新版本中 才加入了等号(=)赋值。因此,对于一般的赋值语句,箭头(<-)与 等号(=)在 功能上是没有区别的,可以通用。但是等号(=)的作用有两个:它既可以赋值,也可以传递函数参数(实际上传参可以看作一种特殊形式的赋值,给参数赋值)。通常情况下,如果等号(=)出现在单独的环境中,它就是赋值;如果写在函数的参数位置,它就是传参。如果你在设置参数的时候使用了箭头(<-),那么你会发现在全局变量里,会多出一个和参数名相同的赋值的变量,容易导致歧义和错误,而且占用命名空间。