次のプログラム コードを使用して、Libras Data Movement set のブートストラップを使用して標準誤差を推定しました。
mydata<-read.table('C:/Users/Desktop/libra.txt', sep=',', header=TRUE)
head(data)
custom.boot <- function(times, data=mydata) {
boots <- rep(NA, times)
for (i in 1:times) {
boots[i] <- sd(sample(data, length(data), replace=TRUE))/sqrt(length(data))
}
boots
}
# Mean standard error
mean(custom.boot(times=1000))
しかし、次のエラーが発生しました:
Error in is.data.frame(x) :
(list) object cannot be coerced to type 'double'
問題を解決する方法を教えてください。前もって感謝します!