get.pseudodata.cox: Obtain pseudodata based on the Cox's regression model.

Description Usage Arguments Value Author(s) Examples

View source: R/get.pseudodata.cox.R

Description

For Cox's regression model, given the current estimates of regression coefficients, working responses and their corresponding weights are obtained.

Usage

1
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: 0=right censored, 1=event at time.

beta

a (p*1) matrix of regression coefficients.

time

a vector or sorted value of Y.

ntime

length of the vector time.

sumevent

a vector of size ntime where each element is the sum of event where Y is equal to each value in time.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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)

icmm documentation built on May 26, 2021, 9:06 a.m.