Karl,
Apologies for the delay, but we are just now getting to the ZeligMultilevel module. I
fixed the issue that you raised, and your code example now runs using the current Beta
versions of Zelig and ZeligMultilevel. To install these, install the packages as
follows:
install.packages("Zelig", type = "source", repos =
"http://r.iq.harvard.edu/")
install.packages("ZeligMultilevel", type = "source", repos =
"http://r.iq.harvard.edu/")
Best,
James
--
James Honaker, Senior Research Scientist
//// Institute for Quantitative Social Science, Harvard University
________________________________
From: zelig-bounces(a)lists.gking.harvard.edu [zelig-bounces(a)lists.gking.harvard.edu] on
behalf of Karl Kosciuch [kosciuch(a)gmail.com]
Sent: Thursday, March 21, 2013 10:48 PM
To: zelig(a)lists.gking.harvard.edu
Subject: [zelig] assistance with predictions for logit.mixed
Hello - I was happy to find the Zelig package as I had been looking for code for
implementing a generalized linear mixed model. I'm having some issues obtaining
predicted probabilities from my rather simple logit.mixed regression. I am using
logit.mixed with avoidance behavior as the binomial response variable, height as the
predictor (ranging from 150 to 1500m), and year as a random effect (there are 3 years).
The model runs fine, but I encounter an error starting with x.out. I've looked at
the package documentation to try to solve the error, and have been unsuccessful. I'd
like to produce one figure showing with the predicted probability on the y-axis and height
on the x-axis. I'd like to show the regression line with the 95% CI for the
predicted probabilities. I've been successful at coding this analysis and figure for
a fixed effects logistic regression, but not so much for the mixed effects logistic
regression.
Thank you
library(Zelig)
library(ZeligMultilevel)
avd$year <- factor(avd$year)
z.out <- zelig(avoid ~ height + tag(1|year), data = avd, model =
"logit.mixed")
summary(z.out)
x.out <-setx(z.out, fn = NULL)
s.out <- sim(z.out, x = x.out)
summary(s.out)
Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), :
'data' must be of a vector type
summary(s.out)
Error in summary(s.out) :
error in evaluating the argument 'object' in selecting a method for function
'summary': Error: object 's.out' not found
--
Karl Kosciuch
kosciuch@gmail.com<mailto:kosciuch@gmail.com>