When attempting to perform projection predictive variable selection (projpred::cv_varsel()) on a model that includes both an s() spline term(s) and a random effect(s) I get the following message:
variable_selection <- cv_varsel(ref_model)
[1] “Computing LOOs…”
|| 0%
Error in model.matrix.gamm4(delete.response(terms(formula)), random = random, :
Not enough (non-NA) data to do anything meaningful
I have tried installing the latest development version of the projpred package from GitHub to resolve the issue, but the problem persists. I have also tried to rerun the model and variable selection on a Linux-based server with R (4.1.0) and RStudio Server to test whether the problem is not specific to my local Mac/system, but the process stopped with the same error.
I am attaching two small datasets (one with a Gaussian and the other with a binary response) and two reproducible examples that give the error.
@AlejandroCatalina: Since you are the expert for additive models, could you take a look at this? I guess this hasn't been resolved yet in the most recent CRAN release.
Hello,
When attempting to perform projection predictive variable selection (projpred::cv_varsel()) on a model that includes both an s() spline term(s) and a random effect(s) I get the following message: variable_selection <- cv_varsel(ref_model) [1] “Computing LOOs…” || 0% Error in model.matrix.gamm4(delete.response(terms(formula)), random = random, : Not enough (non-NA) data to do anything meaningful
I have tried installing the latest development version of the projpred package from GitHub to resolve the issue, but the problem persists. I have also tried to rerun the model and variable selection on a Linux-based server with R (4.1.0) and RStudio Server to test whether the problem is not specific to my local Mac/system, but the process stopped with the same error.
I am attaching two small datasets (one with a Gaussian and the other with a binary response) and two reproducible examples that give the error.
gaussian_data <- read.csv("~/ ..... /gaussian_data.csv") # define pathway
binary_data <- read.csv("~/ ..... /binary_data.csv") # define pathway
Many thanks for looking at this.
Best wishes,
Tom
gaussian_data.csv binary_data.csv