Open MartinSundqvist opened 5 years ago
I'm trying to save stats from an ols model when using the bootcov function.
x <- seq(1,100) y <- 0.2*x + rnorm(100) myData <- data.frame(x,y) d <- datadist(myData) options(datadist="d")
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
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