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
The handling of missing values in gamboost is seriously corrupted. Missing values in glmboost are not an issue. For an example to reproduce the issue see below:
### Simulate data with missing values and check if results are correct.
library("mvtnorm")
library("mboost")
set.seed(1234)
x <- rmvnorm(100, mean = rep(0, 10))
head(x)
beta <- c(1, 2, 3, -1, -2, -3, rep(0, 4))
y <- rnorm(100, mean = crossprod(t(x), beta))
## complete data
data <- as.data.frame(x)
names(data) <- paste0("x", 1:10)
data$y <- y
head(data)
## now data with missings
miss <- data
miss$x1[1:10] <- NA
miss$x3[11:20] <- NA
## complete cases from miss
cc <- miss[complete.cases(miss),]
#############################################
## fit glmboost models
#############################################
mod <- glmboost(y ~ ., data = data)
mstop(mod) <- 1000
coef(mod)
## ok
mod <- glmboost(y ~ ., data = miss)
mstop(mod) <- 1000
coef(mod)
## ok
mod <- glmboost(y ~ ., data = cc)
mstop(mod) <- 1000
coef(mod)
## ok
#############################################
## fit gamboost models
#############################################
mod <- gamboost(y ~ ., baselearner = bols, data = data)
mstop(mod) <- 1000
## extract coefficients (and drop intercept of each base-learner)
sapply(coef(mod), function(x) x[2])
## ok
fm <- as.formula(paste0("y ~ ", paste0(paste0("x", c(2, 4:10)), collapse = "+")))
mod <- gamboost(fm, baselearner = bols, data = miss)
sapply(coef(mod), function(x) x[2])
## ok
fm <- as.formula(paste0("y ~ ", paste0(paste0("x", c(1, 3)), collapse = "+")))
mod <- gamboost(fm, baselearner = bols, data = miss)
sapply(coef(mod), function(x) x[2])
## not ok!!
(This issue was reported by Max Schneider)
The text was updated successfully, but these errors were encountered:
The handling of missing values in
gamboost
is seriously corrupted. Missing values inglmboost
are not an issue. For an example to reproduce the issue see below:(This issue was reported by Max Schneider)
The text was updated successfully, but these errors were encountered: