You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cph( Surv( time, event ) ~ x1 + x2 + cluster( ID ), data = RawData )
It is not even an error, but a warning, but it nevertheless shouldn't be there. After some experimentation I think the problem is with the presence of a missing value and cluster().
The problem seems to occur at the very end of rms:::Design. I think the problem is that jz will index every right hand side term (including the cluster), but fname will only contain the explanatory variables (without the cluster). Thus
names(nmiss)[jz] <- fname[asm != 9]
will try to assign a length-2 vector to one of length 3.
The text was updated successfully, but these errors were encountered:
Here is a minimal reproducible example:
set.seed(1)
RawData <- data.frame( time = runif( 100, 1, 5 ), event = sample( 0:1, 100, replace = TRUE ),
x1 = c( NA, rnorm( 99 ) ), x2 = as.factor( sample( 0:1, 100, replace = TRUE ) ),
ID = c( 1:70, 1:30 ) )
dd <- datadist( RawData )
options( datadist = "dd" )
cph( Surv( time, event ) ~ x1 + x2 + cluster( ID ), data = RawData )
It is not even an error, but a warning, but it nevertheless shouldn't be there. After some experimentation I think the problem is with the presence of a missing value and cluster().
The problem seems to occur at the very end of rms:::Design. I think the problem is that jz will index every right hand side term (including the cluster), but fname will only contain the explanatory variables (without the cluster). Thus
names(nmiss)[jz] <- fname[asm != 9]
will try to assign a length-2 vector to one of length 3.
The text was updated successfully, but these errors were encountered: