IQSS / Zelig

A statistical framework that serves as a common interface to a large range of models
http://zeligproject.org
109 stars 43 forks source link

Error in cbind_all(x) : Argument 1 must have names #329

Open mlatham11 opened 5 years ago

mlatham11 commented 5 years ago

Hi,

I'm using zelig and amelia for the first time to analyze my dissertation data. I have successfully multiply imputed, and subsequently added some additional variables to the imputed datasets:

a.out <- amelia(data_to_use, m = 20, idvars = c("id"), noms = c("nudge_response", "weekend_TF", "gender", "sex"))

One example determining the rolling average and standard deviation of wake up times over each 5-day stretch

for(i in 1:length(a.out$imputations)){ a.out$imputations[[i]] <- a.out$imputations[[i]] %>% group_by(id) %>% mutate(avg_wake_time = rollapply(zoo(waketimeonly), 5, FUN = mean, align = "left", fill=c(waketimeonly, waketimeonly, waketimeonly), partial = TRUE, na.rm = TRUE), sd_wake_time = rollapply(zoo(waketimeonly), 5, FUN = sd, align = "left", fill = c(0,0,0), partial = TRUE, na.rm = TRUE)) }

These manipulations seem to have worked successfully within the amelia object. I am now using zelig to run generalized estimating equations assessing the effect of my intervention on the variability of wake up times:

z.out.prox1 <- zelig(sd_wake_time ~ nudge_TF + weekend_TF + gender, model = "normal.gee", id = "id", data = a.out$imputations, corstr = "independence")

This yields the error in the question title: "Error in cbind_all(x) : Argument 1 must have names"

From the source code I've gathered that cbind is occurring to combine the imputation datasets into one large dataset, but I do not understand the error "Argument 1 must have names."

Any help would be appreciated.

Thanks!