R - tips

bootstrap Cullis 遗传力标准误

2018-12-20  本文已影响15人  董八七

利用Cullis的方法计算遗传力时,不能直接得到标准误,可以使用bootstrap。但对ar模型该怎么处理?

library(boot)
rsq <- function(data, indices) {
  datain <- data[indices,]
  op_asr <- asreml(ht ~ REP,
                   random = ~ FEMALE + REP:PLOT,
                   data = datain)
  op_var <- summary(op_asr)$varcomp
  g <- op_var$component[1]
  predmodelop <-predict(op_asr,classify="FEMALE")
  hc <- 1-(predmodelop$avsed^2/(2*g))
  return(hc)
}

# set.seed(1234)
results <- boot(data=op, statistic=rsq, R=100)

plot(results)
print(results)
# ORDINARY NONPARAMETRIC BOOTSTRAP
# 
# 
# Call:
#   boot(data = nin89, statistic = rsq, R = 100, parallel = c("multicore"))
# 
# 
# Bootstrap Statistics :
#   original     bias    std. error
# t1* 0.9367544 -0.4409224  0.09130884
## bias是original和bootstrap得到的均值的差
上一篇 下一篇

猜你喜欢

热点阅读