Skip to content

varsel() for GAMMs: object not found error #145

Open
@fweber144

Description

@fweber144

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    additiveIssues concerning additive models (GAMs and GAMMs).bugBugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions