I am analyzing data from European Social Survey. Due to quite a bit of missing data I have used the amelia package for imputation. The dependent value is ordinal with 4 values, and I had therefore planned to perform a ordered logistic regression with the "ologit" function in the Zelig-package:
z.out <- zelig(as.factor(Y) ~ X1 + X2, model = "ologit", data = ameliadata)
That code will run, but when I ask for the results the following error code is shown:
z.out:
Model: Combined Imputations Error in se[i, ] <- sqrt(diag(vcovlist[[i]])) : number of items to replace is not a multiple of replacement length
I have five separate imputed datasets. Analyzed separately I am able to use Zelig and the "ologit"-function with each of these five. The problem only arises when I use my combined amelia data-object. I have tried to estimate different models with the same amelia-output, and I only seem to have a problem with the ones related to ordered regression. For example, the "ls"-model runs just fine, and if I change the depended variable to a dichotomous I can also run a "logit"-model without problems.
I am therefore wondering whether anyone has been able to run "ologit" with zelig on amelia data previously or if anyone has any idea about what could be the problem? I will greatly appreciate any ideas and suggestions. Thank you so much for your time and help.
This is an example with the wine dataset from the ordinal package:
library(Amelia)
library(Zelig)
library(ordinal)
data(wine)
w <- wine
set.seed(10)
w[sample(1:nrow(w), 20), "response"] <- NA
w[sample(1:nrow(w), 20), "rating"] <- NA
w[sample(1:nrow(w), 20), "temp"] <- NA
w[sample(1:nrow(w), 5), "contact"] <- NA
w[sample(1:nrow(w), 5), "bottle"] <- NA
w.amelia <- amelia(w, m = 5, idvars="bottle", ords = c("rating","judge"),
noms = c("contact", "temp"),
incheck = TRUE)
z.out <- zelig(rating ~ contact + temp, model = "ologit", data = w.amelia)
summary(z.out)