projpred
projpred copied to clipboard
`varsel()` for GAMMs: `object not found` error
On branch develop
(commit 96d8e11d6f0ad0a1f7836c51700cb676b364bee5), this reprex:
options(mc.cores = parallel::detectCores(logical = FALSE))
data("kidiq", package = "rstanarm")
kidiq_gr <- within(kidiq, {
mom_age_gr <- cut(mom_age,
breaks = unique(quantile(mom_age, probs = seq(0, 1, 0.1))),
include.lowest = TRUE)
})
fit_gauss_gamm <- rstanarm::stan_gamm4(
kid_score ~ s(mom_iq, by = mom_age_gr),
random = ~ (mom_iq | mom_age_gr),
data = kidiq_gr,
iter = 500,
seed = 734572
)
library(projpred)
### To avoid issue #144:
library(lme4)
###
vs_gauss_gamm <- varsel(fit_gauss_gamm, nclusters = 3, nclusters_pred = 5)
throws the following error:
Error in eval(formula[[2]], data, environment(formula)) :
object 'mom_age_gr' not found
This happens because we have not implemented parsing support for by syntax in smooth terms. It is desirable to have but we haven’t had the time yet.
Best, Alejandro On 10 Jun 2021, 4:09 PM +0300, Frank Weber @.***>, wrote:
On branch develop (commit 96d8e11), this reprex: options(mc.cores = parallel::detectCores(logical = FALSE)) data("kidiq", package = "rstanarm") kidiq_gr <- within(kidiq, { mom_age_gr <- cut(mom_age, breaks = unique(quantile(mom_age, probs = seq(0, 1, 0.1))), include.lowest = TRUE) }) fit_gauss_gamm <- rstanarm::stan_gamm4( kid_score ~ s(mom_iq, by = mom_age_gr), random = ~ (mom_iq | mom_age_gr), data = kidiq_gr, iter = 500, seed = 734572 )
library(projpred)
To avoid issue #144:
library(lme4)
vs_gauss_gamm <- varsel(fit_gauss_gamm, nclusters = 3, nclusters_pred = 5) throws the following error: Error in eval(formula[[2]], data, environment(formula)) : object 'mom_age_gr' not found — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.