Dear Eduardo,
Thanks for pointing this out. It's actually the same bug, so the same
solution applies -- install Zelig 2.8-3 per my last email.
Yours,
Olivia Lau
On 8/3/07, Eduardo Leoni <eleoni(a)hmdc.harvard.edu> wrote:
FYI I am seeing a similar problem with the "by" option in zelig. It repeats
the solution for the whole dataset instead of estimating the models by
subset.
-eduardo
On 8/3/07, James Honaker <tercer(a)ucla.edu> wrote:
Dear zeligites, zeligistas? (is there a term of art?)
I ran across curious behaviour in the mi() function in the newest version
of R. I wrote a short code snippet below to demonstrate what is
happening.
Everything works fine in R 2.4.1, but in R 2.5.1, if you have m imputed
datasets, zelig seems to repeatedly estimate the model m times in the
first dataset, rather than moving through them. Thus the combined results
are simply the results from the first imputed dataset.
Again, everything looks fine in R 2.4.1, but fails in R 2.5.1 (these
things seem to crop up every new version).
If it's worth anything, it doesn't appear to be the mi() function itself,
but how zelig handles this object as an argument.
regards,
james.
# test of the mi() function in zelig
# jH, Aug 2, 2007
library(Zelig)
beta1<- -2:2 # This is a set of true coefficients
# Averaging over them should give beta1=0
n<-1000
testdat<-as.list(0)
for(i in 1:length(beta1)){ # Construct datasets
x<-runif(n)
y<-beta1[i]*x + rnorm(n)
testdat[[i]]<- as.data.frame(cbind(y,x))
}
mi.object<-mi(testdat[[1]],testdat[[2]],testdat[[3]],testdat[[4]],testdat[[5]])
output<-zelig(y~x,model="ls",data=mi.object)
print(summary(output)) # should give coefficient on x of 0, not -2.
# This seems to be five copies of the result from the first dataset in R
v2.5.1
# But works just fine in R v2.4.1
print(summary(output), subset=1:5)
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/?info=zelig
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options: