- Code: Select all
#Compute model-averaged estimates of abundance
estimate = matrix(0,ncol=length(robust.results[[1]]$results$derived$estimate),
nrow=nrow(robust.results$model.table))
#Create an empty list for vcv matrix
vcv=list(length=nrow(robust.results$model.table))
#Extract model weights
weight=robust.results$model.table$weight
#The actual model number is the row number for the model.table
model.numbers = as.numeric(row.names(robust.results$model.table))
##Loop over each model in model.table
for(i in 1:nrow(robust.results$model.table))
{
estimate[i,]=robust.results[[model.numbers[i]]]$results$derived$estimate
vcv[[i]]=robust.results[[model.numbers[i]]]$results$derived.vcv[[1]]
}
model.average(list(estimate=estimate,weight=weight, vcv = vcv))
- Code: Select all
Error in model.average.list(list(estimate = estimate, weight = weight, :
dimension of one or more vcv matrices does not match dimenstion (columns) of estimate
Any help is appreciated.