emcc: Fits Cox's regression model for nested case-control data and...

Description Usage Arguments Value Author(s) References Examples

Description

Z covariates observed only for cases and controls

X observed for all subjects in the study such as sex and age

The distribution of Z given X needs is specified non-parametrically on a number of strata specified by X through the stratum variable.

Intensity model

λ_{X,Z}(t)) = λ_S(X) \exp( β^T Z )

The baseline stratification based on S(X) is specified by baseline.stratum.

When fullobsX is given the baseline may be also on Cox form

λ_{X}(t)) = λ_{S(X_1)} \exp( β_X^T X_2 )

where a stratum is used for some covariates and other covariates are modelled as regression effects. This model is specified by fullobsX=X_2, and S(X_1)= baseline.stratum

When stratZ==1 the baseline is stratified by the Z components as specified by baseline.stratum=S(Z)

λ_{X,Z}(t)) = λ_S(Z) \exp( β^T X )

Usage

1
2
3
em.ncc(Zobs,Tobs,status,tau,nno,Nit=1,beta=0,detail=0,
betait=2,em.dif=1,stratum=0,baseline=0,emvar=0,
fullobsZ=0,baseline.stratum=0,stratZ=0)

Arguments

Zobs

covariates observed for cases and controls, fullobsX is also given it means that the first columns of Zobs is the Z from the above intensity and the second part is the covariates X.

Tobs

observed survival times for cases and controls.

status

censoring status for observed cases and controls.

tau

end of observation period. If tau has length equal to the number of subjects that are not cases and controls it is individual censoring times.

nno

number of subjects in the cohort that are not cases or controls.

Nit

number of itterations for EM algorithm.

beta

starting value for regression parameter.

detail

prints out iteration details.

betait

number of itterations for Cox regression score in EM, should be at least 2.

em.dif

constant used for EM aided differentation, default is (em.dif/number of subjects in cohort).

stratum

case specific strata for number of strata for specification of the distribution of Z given X.

baseline

starting value for baseline estimates.

emvar

computes EM based variance by EM aided differentation.

fullobsZ

The fully observed covariates if these are needed for a possible regression model for the baseline

baseline.stratum

stratum for the baseline, defined as the grouping given by S(X), a vector of length ntot=nno+nrow(Zobs).

stratZ

stratifies after the Z covariate that is only observed for cases and controls, stratification given by baseline.stratum

Value

returns an object of type "em.ncc". With the following arguments:

cum

cumulative timevarying regression coefficient estimates are computed within the estimation interval.

baseline

the baseline estimates.

beta

estimate of parametric components of model.

var.beta

variance for beta.

p

the distribution of covariates.

delta

something about convergence.

em.dif

parameter used for EM aided differentation.

covz

the covariates realtes do p.

konv

something about convergence.

Author(s)

Thomas Scheike

References

Scheike and Juul, Biostatistics

Scheike and Maritnussen, SJS

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
###library(nccMLE)

# ud<-simNCC(3728,2,rate=1/0.004,win=1) realistic simulation

ud<-simNCC(500,2,rate=1/0.04,win=1)
Zobs<-ud$Xobs; Tobs<-ud$Tobs; status<-ud$status;
nno<-ud$nno;  tau<-15;

###################################################################
# Fits model with one common baseline and Z independent of X
# \lambda_0(t) \exp( Z^T \beta)
###################################################################
out<-em.ncc(Zobs,Tobs,status,tau,nno,Nit=100,beta=c(-.2,.2),
betait=20,detail=0,emvar=1)
print(c(out$beta,diag(out$var)^.5)); # estimates related to Z
plot(out$baseline,type="l")          # baseline estimates

#### using numDeriv for second derivative
out<-em.ncc(Zobs,Tobs,status,tau,nno,Nit=100,beta=c(-.2,.2),
betait=20,detail=0,emvar=2)
print(c(out$beta,diag(out$var)^.5)); # estimates related to Z


####################################################################
## slow way of fitting the same model, when censoring not the same 
####################################################################
out1<-em.ncc(Zobs,Tobs,status,rep(tau,nno),nno,Nit=100,beta=c(-.2,.2),
betait=20,detail=0,emvar=1)
print(c(out1$beta,diag(out1$var)^.5));     # estimates related to Z
lines(out$baseline,lty=2  )                # baseline estimates
#out$p                                     # distribution of Z

###################################################################
# Fits model : \lambda_S(X)(t) \exp( Z^T \beta)
#  Z | S(X) is equivalent gives conditional distribution of Z | X
###################################################################
strat<-rbinom(nrow(Zobs),1,0.5)
stratnoobs<-rbinom(500-nrow(Zobs),1,0.5)

out.strat<-em.ncc(Zobs,Tobs,status,tau,nno,Nit=100,beta=0,betait=20,
detail=0,stratum=c(strat,stratnoobs),emvar=1,
baseline.stratum=c(strat,stratnoobs))

print(cbind(out.strat$beta,diag(out.strat$var)^.5));
plot(out.strat$baseline[,1:2],type="l")     # baseline estimates
lines(out.strat$baseline[,c(1,3)],type="l") # baseline estimates
out.strat$p                                 # distribution of Z | S(X)

nccMLE documentation built on May 2, 2019, 5:34 p.m.

Related to emcc in nccMLE...