get.pseudodata.cox {icmm} | R Documentation |
Obtain pseudodata based on the Cox's regression model.
Description
For Cox's regression model, given the current estimates of regression coefficients, working responses and their corresponding weights are obtained.
Usage
get.pseudodata.cox(Y, X, event, beta, time, ntime, sumevent)
Arguments
Y |
an (n*1) numeric matrix of time response. |
X |
an (n*p) numeric design matrix. |
event |
an (n*1) numeric matrix of status: of status indicator: |
beta |
a (p*1) matrix of regression coefficients. |
time |
a vector or sorted value of |
ntime |
length of the vector |
sumevent |
a vector of size |
Value
Return a list including elements
z |
an (n*1) matrix of working responses |
sigma2 |
an (n*1) matrix of inverse of weights. |
Author(s)
Vitara Pungpapong, Min Zhang, Dabao Zhang
Examples
data(simCox)
Y<-as.matrix(simCox[,1])
event<-as.matrix(simCox[,2])
X<-as.matrix(simCox[,-(1:2)])
time<-sort(unique(Y))
ntime<-length(time)
# sum of event_i where y_i =time_k
sumevent<-rep(0, ntime)
for(j in 1:ntime)
{
sumevent[j]<-sum(event[Y[,1]==time[j]])
}
# Obtain initial values from lasso
data(initbetaCox)
initbeta<-as.matrix(initbetaCox)
# Get Pseudodata
pseudodata<-get.pseudodata.cox(Y, X, event, initbeta, time, ntime, sumevent)
z<-pseudodata$z
sigma<-sqrt(pseudodata$sigma2)
[Package icmm version 1.2 Index]