| phmm-package {phmm} | R Documentation |
Fits proportional hazards model incorporating random effects. The function implements an EM agorithm using Markov Chain Monte Carlo at the E-step as described in Vaida and Xu (2000).
| Package: | phmm |
| Version: | 0.2 |
| Date: | 2008-01-15 |
| Depends: | survival |
| Suggests: | lme4 |
| License: | GPL2 |
| Packaged: | Fri Jul 11 10:33:57 2008; mdonohue |
| Built: | R 2.8.0; universal-apple-darwin8.11.1; 2008-11-29 12:05:00; unix |
Index:
AIC.phmm Akaike Information Criterion for PHMM
cAIC Conditional Akaike Information Criterion for
PHMM
e1582 Eastern Cooperative Oncology Group (EST 1582)
linear.predictors PHMM Design
loglik.cond PHMM conditional log-likelihood
phmm Proportional Hazards Model with Mixed Effects
phmm-package Proportional Hazards Model with Mixed Effects
phmm.cond.loglik PHMM conditional log-likelihood
phmm.design PHMM Design
pseudoPoisPHMM Pseudo poisson data for fitting PHMM via GLMM
traceHat Trace of the "hat" matrix from PHMM-MCEM fit
Ronghui Xu, Michael Donohue
Maintainer: Michael Donohue mdonohue@ucsd.edu
Vaida, F. and Xu, R. "Proportional hazards model with random effects", Statistics in Medicine, 19:3309-3324, 2000.
N <- 100
B <- 100
n <- 50
nclust <- 5
clusters <- rep(1:nclust,each=n/nclust)
beta0 <- c(1,2)
set.seed(13)
#generate phmm data set
Z <- cbind(Z1=sample(0:1,n,replace=TRUE),
Z2=sample(0:1,n,replace=TRUE),
Z3=sample(0:1,n,replace=TRUE))
b <- cbind(rep(rnorm(nclust),each=n/nclust),rep(rnorm(nclust),each=n/nclust))
Wb <- matrix(0,n,2)
for( j in 1:2) Wb[,j] <- Z[,j]*b[,j]
Wb <- apply(Wb,1,sum)
T <- -log(runif(n,0,1))*exp(-Z[,c('Z1','Z2')]%*%beta0-Wb)
C <- runif(n,0,1)
time <- ifelse(T<C,T,C)
event <- ifelse(T<=C,1,0)
mean(event)
phmmdata <- data.frame(Z)
phmmdata$cluster <- clusters
phmmdata$time <- time
phmmdata$event <- event
fit.phmm <- phmm(Surv(time, event)~Z1+Z2+cluster(cluster),
~-1+Z1+Z2, phmmdata, Gbs = 100, Gbsvar = 1000, VARSTART = 1,
NINIT = 10, MAXSTEP = 100, CONVERG=90)
summary(fit.phmm)