You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I fitted several models and saved them externally through a nohup call. But when I read them back in and try to computePredictedValues I get one of two errors depending on the random effects structure.
With just one random effect - "Error in Eta[[r]][as.character(dfPiNew[, r]), ] : no 'dimnames' attribute for array".
With nested random effects - "Error in PiNew[, r] <- sapply(dfPiNew[, r], function(s) which(rowNames == : incorrect number of subscripts on matrix"
In testing, when I fitted model and computePredictedValues in the same R session, there were no issues. But this is an impractical and risky approach for running the full models, and I would like to be able to work flexibly after fitting the model.
See below for an example of how I am specifying the models. I tried defining the random effects as both levels() and unique() but I get the same issue.
I finally got to the bottom of this. The solution had to do with the the class of variables in the study design and random levels. The fact that I was passing the study design to the Hmsc function as a matrix was then also an issue. I notice there are a few corners of the internet where people encountered this problem, so the following script might help
I fitted several models and saved them externally through a nohup call. But when I read them back in and try to computePredictedValues I get one of two errors depending on the random effects structure.
With just one random effect - "Error in Eta[[r]][as.character(dfPiNew[, r]), ] : no 'dimnames' attribute for array".
With nested random effects - "Error in PiNew[, r] <- sapply(dfPiNew[, r], function(s) which(rowNames == : incorrect number of subscripts on matrix"
In testing, when I fitted model and computePredictedValues in the same R session, there were no issues. But this is an impractical and risky approach for running the full models, and I would like to be able to work flexibly after fitting the model.
See below for an example of how I am specifying the models. I tried defining the random effects as both levels() and unique() but I get the same issue.
Any advice would be greatly appreciated.
The text was updated successfully, but these errors were encountered: