Pyy-Martikainen Marjo
2005-Oct-06 08:33 UTC
[R] Testing strata by covariate interactions in coxph
Dear list members, I am working with a Cox ph model for the duration of unemployment. The event of interest in my analysis is getting employed. I have various background variables explaining this event: age, sex, education etc. I have multiple unemployment spells per person. I use a model with person-specific frailty terms in order to take into account the correlation of spells by the same person. The persons can be divided into 3 groups, say A, B and C. I am interested to see whether there are differences between estimated covariate effects between the groups. Therefore I specify a model with strata by covariate interactions. I would like to conduct a Wald test for the null hypothesis "no differences between any covariate effects in the 3 groups". This is similar to the example by Therneau & Grambsch in their book "Modeling survival data. Extending the Cox model", p. 47, except that I have interactions with many covariates that I would like to test jointly (and a frailty term). In S-plus there seems to be a function waldtest that does the job. Is there anything similar in R that I could use? Here is the code for my model. The covariates are a subset of all the covariates that I use. fit=coxph(Surv(tykesto, tyoll)~nainen*strata(group)+I(ika-mean(ika))*strata(group) +I(ika2-mean(ika2))*strata(group)+keski*strata(group)+korkea*strata(group) +frailty(hnro),data=coxdata) tyoll2 =1, if event "getting employed" has occurred, 0 otherwise nainen = 1, if female 0 otherwise ika = age in years at the start of the spell ika2 = age squared keski =1, if secondary education, 0 otherwise korkea=1, if higher education, 0 otherwise hnro = person identifier group = group identifier Thank you in advance for any help. Marjo Pyy-Martikainen
On Thu, 6 Oct 2005, Pyy-Martikainen Marjo wrote:> I specify a model with strata by covariate interactions. I would like to > conduct a Wald test > for the null hypothesis "no differences between any covariate effects in the 3 > groups".The "survey" package has a function regTermTest (which isn't specific to survey models -- it works on anything with vcov() and coef() methods). -thomas