`varsel()` for GAMMs: `object not found` error
Open
Nobody has claimed this yet.
additive
bug
- Dominant language
- R
- Stars
- 114
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the supplied R example at the varsel() call on commit 96d8e11d6f0ad0a1f7836c51700cb676b364bee5, then trace how the GAMM formula accesses mom_age_gr. Done means the reprex completes without the object-not-found error; the issue names no file or test to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100