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
library(INLA)
library(inlabru)
data("veteran", package = "survival")
veteran$time.m <- round(veteran$time / 30, 3)
exp.vet <- inla(inla.surv(time.m, status) ~ 1,
data = veteran, family = "exponential.surv")
summary(exp.vet)
# Attempted inlabru version:
exp.vet2 <- bru(components = inla.surv(time.m, status) ~ 1,
family = like(family = "lognormal.surv",
formula = inla.surv(time.m, status) ~ 1,
data = veteran))
Error in eval.if.function(y, points) : unsupported data.
The error is generated by the make.stack() function, which sends as.data.frame(lhood$data)[, lhood$response] into the eval.if.function() function, which tests whether it's a function or if it's numeric. Since lhood$response is a character vector with the names in inla.surv() (in this case, "time.m" and "status"), the result is a data frame and thus it is neither numeric nor a function. The else in eval.if.function() is triggered, which reports the error.
The text was updated successfully, but these errors were encountered:
For future devel reference:
inla.surv() generates a list of variables, that converts survival type data into information needed by the .surv response models. Current inlabru code can only handle numeric vectors as observation variables, so it needs to be either extended to handle collections of vectors, or there needs to be a special like() feature to handle survival data, or a combination of those.
Minimal Example:
The error is generated by the
make.stack()
function, which sendsas.data.frame(lhood$data)[, lhood$response]
into theeval.if.function()
function, which tests whether it's a function or if it's numeric. Sincelhood$response
is a character vector with the names ininla.surv()
(in this case,"time.m"
and"status"
), the result is a data frame and thus it is neither numeric nor a function. The else ineval.if.function()
is triggered, which reports the error.The text was updated successfully, but these errors were encountered: