I have a stan_lm object - 15 covariates or factors/33 predictors.
There are no missing values in the data set.
I wish to try model selection.
The following is returned when I do get_refmodel(object) or varsel(object):
Error: NAs are not allowed in ‘newdata’.
The console output with traceback is:
StandardizedOME.stan_lm.5c.refmodel ← get_refmodel(StandardizedOME.stan_lm.5c)
Error: NAs are not allowed in ‘newdata’.
traceback()
12: stop(“NAs are not allowed in ‘newdata’.”, call. = FALSE)
11: validate_newdata(object, newdata = newdata, m = NULL)
10: posterior_linpred.stanreg(object, newdata = data.frame(zt), transform = T,
offset = rep(0, nrow(zt)))
9: rstanarm::posterior_linpred(object, newdata = data.frame(zt),
transform = T, offset = rep(0, nrow(zt)))
8: t(rstanarm::posterior_linpred(object, newdata = data.frame(zt),
transform = T, offset = rep(0, nrow(zt))))
7: predfun(z)
6: family$linkfun(predfun(z))
5: family$linkinv(family$linkfun(predfun(z)) + offset)
4: predmu(z, offset)
3: init_refmodel(z = z, y = y, family = fam, x = x, predfun = predfun,
dis = dis, offset = offset, wobs = wobs, wsample = wsample,
intercept = intercept, cvfits = NULL, cvfun = cvfun)
2: get_refmodel.stanreg(StandardizedOME.stan_lm.5c)
1: get_refmodel(StandardizedOME.stan_lm.5c)
sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.1 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] projpred_1.1.5 performance_0.4.3 parameters_0.4.1 bayestestR_0.5.1
[5] cowplot_1.0.0 shinystan_2.5.0 shiny_1.4.0 bayesplot_1.7.1
[9] rstanarm_2.19.2 Rcpp_1.0.3 rstantools_2.0.0 rstan_2.19.2
[13] StanHeaders_2.21.0-1 emmeans_1.4.4 lmerTest_3.1-1 lme4_1.1-21
…
I can’t a mention of this error in documents pertaining to projpred.
Nathan