R/uni.Wald.R

Defines functions uni.Wald

Documented in uni.Wald

uni.Wald=function(t.vec, d.vec, X.mat){
  n=length(t.vec)
  X.mat=as.matrix(X.mat)
  p=ncol(X.mat)

  Beta=Z=P=numeric(p)
  for(j in 1:p){
    res=summary(coxph(Surv(t.vec,d.vec)~X.mat[,j]))$coef
    Beta[j]=res[1]
    Z[j]=res[4]
    P[j]=res[5]
  }
  names(Z)=names(P)=names(Beta)=colnames(X.mat)
  list(beta=Beta,Z=Z,P=P)
}

Try the compound.Cox package in your browser

Any scripts or data that you put into this service are public.

compound.Cox documentation built on July 26, 2023, 5:39 p.m.