dnase(tpr)
dnase()所属R语言包:tpr
rhDNase Data
rhDNase数据
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Randomized trial of rhDNase for treatment of cystic fibrosis
随机试验的rhDNase治疗囊肿性纤维化
用法----------Usage----------
data(dnase)
格式----------Format----------
A data frame with 767 observations on the following 6 variables.
767观察以下6个变量的数据框。
idsubject id
id主题ID
rxtreatment arm: 0 = placebo, 1 = rhDNase
rx治疗组:0 =安慰剂,1 = rhDNase
fevforced expirotary volume, a measure of lung capacity
fev被迫expirotary的量,衡量肺活量
futimefollow time
futime遵循时间
iv1IV start time
iv1 IV开始时间
iv2IV stop time
iv2 IV停止时间
Details
详细信息----------Details----------
During an exacerbation, patients received intravenous (IV) antibiotics and were considered unsusceptible until seven exacerbation-free days beyond the end of IV therapy.
在恶化,患者接受静脉注射(IV)抗生素,直到7恶化天的静脉注射治疗结束之后,被认为不易受到。
A few subjects were infected at the time of enrollment, for instance a subject has a first infection interval of -21 to 7. We do not count this first infection as an "event", and the subject first enters the risk set at day 7.
少数受试者感染在入学的时候,例如,一个题目有第一次感染间隔-21 7。作为一个“事件”,我们不指望这第一次感染的主题,首先进入的风险集中在7天。
源----------Source----------
Therneau and Grambsch (2000). Modeling Survival Data: Extending the Cox model. Springer. http://www.mayo.edu/hsr/people/therneau/book/data/dnase.html
Therneau Grambsch(2000年)。生存数据建模扩展Cox比例风险模型。斯普林格。 http://www.mayo.edu/hsr/people/therneau/book/data/dnase.html
参考文献----------References----------
Yan and Fine (2008). Analysis of Episodic Data with Application to Recurrent Pulmonary Exacerbations in Cystic Fibrosis Patients. JASA.
实例----------Examples----------
## This example steps through how to set up for the tpr function.[#这个例子通过如何设置的TPR函数的步骤。]
## Three objects are needed:[#三个对象是必需的:]
## 1) response process (an object of "lgtdl")[#1)响应过程(一个对象“lgtdl”)]
## 2) data availability process (an object of "lgtdl")[#2)数据可用性过程(对象“lgtdl”)]
## 3) a time-independent covariate matrix[#3)的与时间无关的协变量矩阵]
data(dnase)
## extracting the unique id and subject level information[#提取唯一的ID和学科水平的信息]
dat <- unique(dnase[,c("id", "futime", "fev", "rx")])
## construct temporal process response for recurrent enent[#构造演化过程经常性的enent响应]
rec <- lapply(split(dnase[,c("id", "iv1", "futime")], dnase$id),
function(x) {
v <- x$iv1
maxfu <- max(x$futime)
## iv1 may be negative!!![IV1可能是负的!]
if (is.na(v[1])) c(0, maxfu + 1.0)
else if (v[1] < 0) c(v[1] - 1, v[!is.na(v)], maxfu + 1.0)
else c(0, v[!is.na(v)], maxfu + 1.0)
})
yrec <- lapply(rec,
function(x) {
dat <- data.frame(time=x, cov=1:length(x)-1)
len <- length(x)
dat$cov[len] <- dat$cov[len - 1]
as.lgtdl(dat)
})
## construct temporal process response for accumulative days exacerbation[#构造演化过程的响应累计天发作]
do1.acc <- function(x) {
gap <- x$iv2 - x$iv1 + 1
if (all(is.na(gap))) yy <- tt <- NULL
else {
gap <- na.omit(gap)
yy <- cumsum(rep(1, sum(gap)))
tt <- unlist(sapply(1:length(gap), function(i)
seq(x$iv1[i], x$iv2[i], by=1.0)))
}
yy <- c(0, yy, rev(yy)[1])
if (!is.null(tt[1]) && tt[1] < 0)
tt <- c(tt[1] - 1, tt, max(x$futime) + 1.0)
else tt <- c(0, tt, max(x$futime) + 1.0)
as.lgtdl(data.frame(time=tt, cov=yy))
}
yacc <- lapply(split(dnase[,c("id", "iv1", "iv2", "futime")], dnase$id),
do1.acc)
## construct data availability (or at risk) indicator process[#构造数据的可用性(或风险)指标进程]
tu <- max(dat$futime) + 0.001
rt <- lapply(1:nrow(dat),
function(i) {
x <- dat[i, "futime"]
time <- c(0, x, tu)
cov <- c(1, 0, 0)
as.lgtdl(data.frame(time=time, cov=cov))
})
## time-independent covariate matrix[时间独立的协方差阵]
xmat <- model.matrix(~ rx + fev, data=dat)
## time-window in days[#以天为单位的时间窗口]
tlim <- c(10, 168)
good <- unlist(lapply(yrec, function(x) x$time[1] == 0))
## fully functional temporal process regression[#全功能的演化过程回归]
## for recurrent event[#经常性事件]
m.rec <- tpr(yrec, rt, xmat[,1:3], list(), xmat[,-(1:3),drop=FALSE], list(),
tis=10:160, w = rep(1, 151), family = poisson(),
evstr = list(link = 5, v = 3))
par(mfrow=c(1,3), mgp=c(2,1,0), mar=c(4,2,1,0), oma=c(0,2,0,0))
for(i in 1:3) ci.plot(m.rec$tis, m.rec$alpha[,i], sqrt(m.rec$valpha[,i]))
## hypothesis test of significance[假设检验的意义]
## integral test, covariate index 2 and 3[#综合测试,协指数2和3]
sig.test.int.ff(m.rec, idx=2:3, ncut=2)
sig.test.boots.ff(m.rec, idx=2:3, nsim=1000)
## constant fit[#恒定的合适的]
cfit <- cst.fit.ff(m.rec, idx=2:3)
## goodness-of-fit test for constant fit[#善良的不断配合合适的测试]
gof.test.int.ff(m.rec, idx=2:3, ncut=2)
gof.test.boots.ff(m.rec, idx=2:3, nsim=1000)
## for cumulative days in exacerbation[#急性发作的累计天数]
m.acc <- tpr(yacc, rt, xmat[,1:3], list(), xmat[,-(1:3),drop=FALSE], list(),
tis=10:160, w = rep(1, 151), family = gaussian(),
evstr = list(link = 1, v = 1))
par(mfrow=c(1,3), mgp=c(2,1,0), mar=c(4,2,1,0), oma=c(0,2,0,0))
for(i in 1:3) ci.plot(m.acc$tis, m.acc$alpha[,i], sqrt(m.acc$valpha[,i]))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|