IQSS / ZeligMultilevel

Five Multi-level Zelig Models
8 stars 3 forks source link

Indexing in Mixed Effect Models #2

Closed whatever closed 8 years ago

whatever commented 12 years ago

There seems to be an issue with the mixed family of models in Zelig.

This potentially is related to Issue #1

The original thread on the mailing list can be found here: https://lists.gking.harvard.edu/pipermail/zelig/2012-February/000999.html

cchoirat commented 8 years ago

No longer an issue in Zelig 5

library(Zelig)

set.seed(1000)

x <- runif(1000, -1, 1)
y <- x + rnorm(1000)
wt <- rexp(1000)
id <- rep(1:20, times = 50)
d <- as.data.frame(cbind(y, x, wt, id))

m1 <- zlsmixed$new()
m1$zelig(y ~ x + (1|id), weights = "wt", data = d)
m1

m2 <- lmer(y ~ x + (1|id), weights = wt, data = d)
summary(m2)