Note that you lose the aggregated standard errors from doing
summary(zelig-output-from-a-MI-list-object).
On Wed, Feb 8, 2012 at 1:40 PM, Trey Causey <tcausey(a)uw.edu> wrote:
Yes, that works. Thanks very much!
On Wed, Feb 8, 2012 at 1:33 PM, Matt Owen <mowen(a)iq.harvard.edu> wrote:
The issue may be with how Zelig interfaces with
Amelia's mi class.
Please attempt the following (modified) zelig command:
model.full <- zelig(
attitude ~ age + married + male + income + tag(1 |
state),
model = "ls.mixed",
data = imp$imputations$imp1,
REML = FALSE,
subset = wave4
)
Notice that the difference is in the data parameter:
data = imp$imputations$imp1
If this produces an error, we can narrow down the problem further.
Otherwise, the
issue is likely a bug in Zelig's implementation for
multilevel models.
- Matt
On Feb 8, 2012, at 4:20 PM, Trey Causey wrote:
> Yes, it's exactly the same.
>
> On Wed, Feb 8, 2012 at 1:18 PM, Matt Owen <mowen(a)iq.harvard.edu> wrote:
>> Hi Trey -
>> Is the error identical across both versions of Zelig?
>>
>> On Feb 8, 2012, at 4:10 PM, Trey Causey wrote:
>>
>>> Hello all:
>>>
>>> I have replicated this with the current (stable) and alpha releases of
>>> Zelig. I cannot simulate quantities of interest using a mixed-effects
>>> model estimated on data imputed with Ameila. setx() works fine, but
>>> the sim command runs for a while and then reports it is unable to find
>>> one of my predictor variables (variable names changed as they are
>>> irrelevant). Code below:
>>>
>>> model.full <- zelig(attitude ~ age + married + male + income + tag(1 |
>>> state), model = "ls.mixed", data = imp$imputations, REML = FALSE,
>>> subset = wave4)
>>>
>>> x.out <- setx(model.full)
>>>
>>> simout <- sim(x.out, x = x.out)
>>>
>>> The model estimates fine with the zelig() function, setx() works fine
>>> in setting the explanatory variables at their means, but when I
>>> attempt to use sim(), I get:
>>>
>>> Error in eval(expr, envir, enclos) : object 'age' not found
>>>
>>> A traceback produces this:
>>>
>>> 13: eval(expr, envir, enclos)
>>> 12: eval(predvars, data, env)
>>> 11: model.frame.default(object, data, xlev = xlev)
>>> 10: model.frame(object, data, xlev = xlev)
>>> 9: model.matrix.default(parsefml$fixed, data = D)
>>> 8: model.matrix(parsefml$fixed, data = D)
>>> 7: model.matrix(parsefml$fixed, data = D)
>>> 6: is.data.frame(x)
>>> 5: colnames(model.matrix(parsefml$fixed, data = D))
>>> 4: qi.mer(object[[1]], simpar = simpar, x = as.matrix(x), x1 = if
>>> (!is.null(x1)) as.matrix(x1))
>>> 3: qi(object[[1]], simpar = simpar, x = as.matrix(x), x1 = if
>>> (!is.null(x1)) as.matrix(x1))
>>> 2: sim.setx.MI(model.full, x = x.out)
>>> 1: sim(model.full, x = x.out)
>>>
>>> Any suggestions?
>>>
>>> Thanks very much,
>>> Trey Causey
>>> -
>>> --
>>> Zelig Mailing List, served by HUIT
>>> Send messages: zelig(a)lists.gking.harvard.edu
>>> [un]subscribe Options:
http://lists.gking.harvard.edu/mailman/listinfo/zelig
>>
Zelig program information:
http://gking.harvard.edu/zelig/
>> Zelig mailing list
>> Zelig(a)lists.gking.harvard.edu
>>
https://lists.gking.harvard.edu/mailman/listinfo/zelig
>
-
--
Zelig Mailing List, served by HUIT
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/mailman/listinfo/zelig
Zelig program information:
http://gking.harvard.edu/zelig/
Zelig mailing list
Zelig(a)lists.gking.harvard.edu
https://lists.gking.harvard.edu/mailman/listinfo/zelig