harrelfe / rms

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

Bootcov not saving stats #75

Open MartinSundqvist opened 5 years ago

MartinSundqvist commented 5 years ago

I'm trying to save stats from an ols model when using the bootcov function.

Generate data

x <- seq(1,100) y <- 0.2*x + rnorm(100) myData <- data.frame(x,y) d <- datadist(myData) options(datadist="d")

Model fitting and bootstrap attempt

mod <- ols(y~x, myData, x=T, y=T) mod.boot <- bootcov(mod, B=1000, stat="R2")

This returns the error

Error in stats[b] <- f$stats[stat] : replacement has length zero