s-news
[Top] [All Lists]

[S] time dependent covariate in coxph

To: s-news@wubios.wustl.edu
Subject: [S] time dependent covariate in coxph
From: James Song <jsong@bcm.tmc.edu>
Date: Wed, 20 Sep 2000 11:18:37 -0500
Sender: owner-s-news@wubios.wustl.edu
Dear S users,

This is a cox regression model fitting question. I have the ages of a group of people. I want to compare their ages to the baseline population hazard (mu(t)). mu(t) is taken from the published lifetable, it includes hazard from 0 year old to 101 year old. The model I am trying to fit is a cox model: hazard(t)=hazard0(t)exp(b1+b2 log(mu(t))). I included mu(t) as a time dependent covarite. However, the coxph returns an error message of X matrix being singular. Here is part of the input data.

cen: censoring status,
stop: death age of the subject
start: stop - 1
logus1: log(mu(stop)), log baseline hazard for age=stop. for example, the first subject died at age 64. The baseline hazard from population for age 64 is 0.024699, so log(mu(64))=-0.3765395.

Am I using the correct command below?  Thanks for your advice!

James Song


> temp1
    start cen treat id    logus1 stop
  1    63   1     1  1 -3.765395   64
  2    74   1     1  1 -2.992841   75
  3    78   1     1  1 -2.703324   79
  4    76   1     1  2 -2.848123   77
  5    79   1     1  2 -2.632055   80
  6    24   1     1  3 -5.230226   25
  7    56   1     1  4 -4.319501   57
  8     0   1     1  5 -1.947467    1
  9     0   1     1  5 -1.947467    1
10    14   1     1  5 -5.892593   15
11    63   1     1  5 -3.765395   64
12    65   1     1  5 -3.635211   66
13     1   1     1  6 -3.302148    2
14    81   1     1  6 -2.489816   82
15    22   1     1  7 -5.195699   23
16    23   1     1  7 -5.204998   24
17    73   1     1  7 -3.063109   74
18    74   1     1  7 -2.992841   75
...

> coxph(Surv(start,stop,cen)~logus1,temp1)
Call:
coxph(formula = Surv(start, stop, cen) ~ logus1, data = "">

       coef exp(coef) se(coef)  z  p
logus1   NA        NA        0 NA NA

Likelihood ratio test=0  on 0 df, p=NA  n= 184
Warning messages:
1: X matrix deemed to be singular; variable 1 in: coxph(Surv(start, stop, cen) ~ logus1, temp1)
2: One or more nonpositive parameters in: pchisq(logtest, df)
>


----------------------------------------------------------------------- This message was distributed by s-news@wubios.wustl.edu. To unsubscribe send e-mail to s-news-request@wubios.wustl.edu with the BODY of the message: unsubscribe s-news
<Prev in Thread] Current Thread [Next in Thread>
  • [S] time dependent covariate in coxph, James Song <=