Is there any reason you can#'t use confint()? e.g.
test1 <- list(time=c(4,3,1,1,2,2,3),
status=c(1,1,1,0,1,1,0),
x=c(0,2,1,1,1,0,0),
sex=c(0,0,0,0,1,1,1))
confint(coxph(Surv(time, status) ~ x + strata(sex), test1))
Another trick is to use predict(), with new data at all of hte levels
you are interested in:
pred1 <- list(x=c(0:2, 0:2),
sex=c(0,0,0,1,1,1))
predict(coxph(Surv(time, status) ~ x + strata(sex), test1),
newdata=pred1, type="lp" , se.fit=TRUE)
(it doesn't provide CIs, but mean +/-1.96s.e. should work OK for the
linear predictor scale)
Bob
On 05/06/18 18:47, Bertolo, Andrea wrote:
Hi everyone,
I have a doubt about the way to calculate 95% CI for coefficients in
the stratified Cox proportional hazard models and your help is welcomed
.
Say that I have a variable of interest Imi and a stratifying variable
UV in a interaction model (since the interaction between Imi and UV is
of interest for me and the interaction model has a better fit than the
no-interaction model:
library(survival)
model1 <- coxph(Surv(start,stop, Status.time)
~ Imi + Imi:UV + strata(UV) + cluster(ID),
weights = NB_Event, data=Data.unfold)
Whereas it is pretty straightforward to calculate the coefficients (and
associated HR) for each combination of Imi and UV, I am not sure about
how to calculate the associated CI (note that, of course, I got the CI
for the estimate of "Imi:UV" from the output of model1).
Is it correct to calculate separately a model for each UV level and use
the CI for the Imi variable to get the CI for the two levels of UV (see
below) ?
# 2 models (one per UV level)
data.Low <- subset(Data.unfold,UV=="low")
model2.1 <- coxph(Surv(start,stop, Status.time)
~ Imi + cluster(ID),
weights =
NB_Event, data=data.Low)
data.High <- subset(Data.unfold,UV=="high")
model2.2 <-
coxph(Surv(start,stop, Status.time)
~ Imi +
cluster(ID),
weights = NB_Event, data=data.High)
Alternatively, is there a way to get the CI directly from the output of the
stratified model ?
Many thanks
Andrea Bertolo
Université du Québec à Trois-Rivières
3351, bd des Forges
C.P.500, Trois-Rivières (Québec) Canada
G9A 5H7
_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
--
Bob O'Hara
Institutt for matematiske fag
NTNU
7491 Trondheim
Norway
Mobile: +49 1515 888 5440
Homepage: http://www.ntnu.edu/employees/bob.ohara
Journal of Negative Results - EEB: www.jnr-eeb.org
_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology