harrelfe / rms

Regression Modeling Strategies
https://hbiostat.org/R/rms
Other
172 stars 48 forks source link

Fatal error in Gls(B > 0) #128

Open DrJerryTAO opened 1 year ago

DrJerryTAO commented 1 year ago

Hi @harrelfe, I used Gls() with longitudinal data for bootstrapping, as random effect variance was nearly zero. The example operation in the help document worked, but with my own data, every time I tried bootstrapping, I encountered a fatal error message that I had to restart R session. It may have something to do with the fitting stage, where a bootstrapped sample does not have convergence. But it did not depend on the number of replicate, so the error could also come from the bootstrap result summary stage. It was okay only one time when I tested with B = 1, but the next time with random sampling, it still resulted in fatal error even with B = 1.

Would you consider updating it so a model fitting of a bootstrapped replicate with an error will generate NA instead of a fatal error in the bootstrap records?

harrelfe commented 2 months ago

Please provide a minimal working example here, with simple simulated data and code.