[R] coxph means not equal to means of model matrix
Stephen@Bond @end|ng |rom c|bc@com
Fri Sep 3 19:59:37 CEST 2021
I looked at the nocenter and it says (-1,0,1) values but it seems that any three-level factor is included in that (represented as 1,2,3 in R) .
Also, is the baseline curve now showing the reference level and not the fictional .428 sex? If I predict the risk for a new row, should I multiply the coefficient shown in the output by 1 for a sex=1? It used to be (1-.428)*coef.
Thanks for clarifying.
From: Therneau, Terry M., Ph.D. <therneau using mayo.edu>
Sent: Friday, 3 September, 2021 12:37
To: Bond, Stephen <Stephen.Bond using cibc.com>
Cc: R-help <r-help using R-project.org>
Subject: Re: coxph means not equal to means of model matrix
See ?coxph, in particular the new "nocenter" option.
Basically, the "mean" component is used to center later computations. This can be critical for continuous variables, avoiding overflow in the exp function, but is not necessary for 0/1 covariates. The fact that the default survival curve would be for a sex of .453, say, was off-putting to many.
On 9/3/21 11:01 AM, Bond, Stephen wrote:
Please, help me understand what is happening with the means of a Cox model?
R version 4.0.2 (2020-06-22) -- "Taking Off Again"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
According to the help coxph.object has a component holding the means of the X (model.matrix). This does not hold any more.
test1 <- list(time=c(4,3,1,1,2,2,3),
m1 <- coxph(Surv(time, status) ~ x + sex, test1)
## x sex1
## 0.7142857 0.0000000
## x sex1
## 0.7142857 0.4285714
Will new observations be scored using the zero mean from the object?? Is this just a reporting change where $means shows the reference level and no longer the mean of the model matrix??
ATTENTION : This email originated outside your organization. Exercise caution before clicking links, opening attachments, or responding with personal information.
[[alternative HTML version deleted]]
More information about the R-help