0

I am running a for loop for repeatability analysis using rptR. I want to store all of the confidence interval results from each run of the repeatability analysis in a data frame. I use the following code in the loop to return the list of CI values:

for(i in 1:P){
  m1<-rptR::rpt(Behaviour~Temperature+(1|ID), grname="ID", data=Data, datatype="Gaussian", nboot=10, 
  npermut=10)
  R_value[i] <- m1$R
  CI_value[i] <- m1$CI
}

However, the CI value always comes back as 0.95 - stating that it is a 95% confidence interval, rather than providing me with the actual range of values for the CI. Does anyone know how to return the actual CI values?

Here is the model output from running rptR just once:

Repeatability for ID
R  = 0.847
SE = 0.134
CI = [0.484, 0.982]
P  = 0.00152 [LRT]
     0.015 [Permutation]
4

1 回答 1

2

我认为您正在寻找提取CI_emp而不是CI因为它将具有多个值更好地将其存储在列表中。尝试 :

R_value <- numeric(P)
CI_value <- vector('list', P)

for(i in 1:P){
  m1<-rptR::rpt(Behaviour~Temperature+(1|ID), grname="ID", 
                data=Data, datatype="Gaussian", nboot=10, npermut=10)
  R_value[i] <- m1$R
  CI_value[[i]] <- m1$CI_emp
}
于 2020-07-15T09:05:14.033 回答