Maggie Cheang wrote:
Dear all,
I am trying to get U-statistics on two predictors.
But when I run the rcorrp.cens function, there is an error and below is
my script and the error message.
i really appreciate if someone can shed light on this.
> lp1 <- predict(hm01, type='lp')
> lp2 <- predict(hm02, type='lp')
>
> rcorrp.cens(lp1,lp2, Surv(SURVYRS, BRDEATH == 1), data = mydata)
Error in rcorrp.cens(lp1, lp2, Surv(SURVYRS, BRDEATH == 1), data =
mydata) :
unused argument(s) (data = list(BSERIES = c(6, 15, 16, 18, 21, 22,
23, 26, 27, 29, 32, 33, 34, 36, 37, 41, 45, 46, 47, 48, 53, 54, 56, 58,
59, 60, 61, 62, 65, 68, 70, 71, 73, 74, 81, 83, 84, 86, 87, 88, 91, 100,
101, 111, 114, 115, 117, 118, 119, 124, 127, 131, 134, 135, 137, 138,
143, 146, 154, 156, 157, 158, 160, 162, 168, 169, 173, 178, 179, 181,
183, 186, 188, 192, 193, 194, 195, 196, 198, 199, 201, 205, 207, 208,
213, 214, 218, 219, 223, 224, 225, 226, 230, 233, 238, 239, 244, 247,
248, 257, 258, 262, 264,
when I didn't put data = mydata, it said object: "SURVYRS" not found.
But I had run the hm01, hm02 (which is the cph(Surv(SURVYRS, BRDEATH ==
1) using SURVYRS and it work
Thanks a million,
Maggie
mcheang@mac.com
The error message tells all. rcorrp.cens does not take a data argument.
You will need either to attach the data frame containing SURVYRS and
BRDEATH or prefix those variables with the data frame and $. I usually
do the following:
S <- Surv(mydata$SURVYRS, mydata$BRDEATH==1)
# if BRDEATH is 0 or 1 just say mydata$BRDEATH
rcorrp.cens(x1, x2, S)
Frank
--
Frank E Harrell Jr Professor and Chair School of Medicine
Department of Biostatistics Vanderbilt University
|