Good morning
If I run
<<<
susan.lsmixed.out <- zelig(formula = unprot_vag_sex ~ married + age + TREATMENT.ARM*time + highest_grade + income + tag(1|id),
data = susanMI.out$imputations, model = "ls.mixed")
summary(susan.lsmixed.out)
>>>>
I get an error
Error in x$coef : $ operator is invalid for atomic vectors
Searching the archives, I see that others have had similar problems. Is there a workaround?
summary(susan.lsmixed.out[[1]])
works fine; should I then average across the five imputed data sets?
thanks!
Peter
Peter L. Flom, PhD
Statistical Consultant
Website: http://www DOT statisticalanalysisconsulting DOT com/
Writing; http://www.associatedcontent.com/user/582880/peter_flom.html
Twitter: @peterflom
-
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 program information: http://gking.harvard.edu/zelig/
Hi,
Thanks for your work on Zelig and Amelia. Very useful!
I can't get a summary when estimating a twosls model on
amelia-imputed data. The object is created and it seems OK. See
example below.
Best,
Vincent Arel-Bundock
-------------------------------------------------------
This example requires the Kmenta data that is distributed with the sem package:
data(Kmenta)
Kmenta[2,3]<-NA
mu1<-Q ~ P + F + A
mu2<-P ~ D + F + A
inst<-~ D + F + A
fm<-list(mu1=mu1, mu2=mu2, inst=inst)
kmenta.out<-zelig(fm, data=Kmenta, model="twosls")
a.out<-amelia(Kmenta, m = 5)
imputed.out<-zelig(fm, data=a.out$imputations, model="twosls")
> summary(imputed.out)
Error in apply(coef1, 1, mean) : dim(X) must have a positive length
-
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 program information: http://gking.harvard.edu/zelig/
Hi,
I'm using Zelig's ls.mixed model, and while there are instructions for how to
use `setx()' and `sim()' in the manual, trying to use sim() returns an error:
Error in .local(object, ...) : Code not written yet.
The list-serves mention similar problems, but no one has mentioned this error
code exactly. Any ideas?
Is it the same problem as lmer()has with mcmcsamp() and "non-trivial Theta"?
https://stat.ethz.ch/pipermail/r-sig-mixed-models/2008q4/001464.html
Code snippet:
#generating example data
x1<-rnorm(1000, 0, 4)
grp<-c(rep("grp1", 250), rep("grp2", 250), rep("grp3", 250), rep("grp4", 250))
createinter<-function(x){
+ if (x=="grp1"){out<-.5}
+ else if (x=="grp2"){out<-0}
+ else if (x=="grp3"){out<- -1}
+ else {out<-1}
+ }
x2<-sapply(grp, FUN=createinter)
x3<-rbinom(1000, 1, .5)
y<-4*x1+x2+2*x3+x3*x1+rnorm(1000, 0, 1)
dat<-as.data.frame(matrix(nrow=1000, ncol=4))
x3<-rbinom(1000, 1, .5)
y<-4*x1+x2+2*x3+x3*x1+rnorm(1000, 0, 1)
dat<-as.data.frame(matrix(nrow=1000, ncol=4))
x<-sim(mod1)
dat[,1:3]<-cbind(x1, x3, y)
dat[,4]<-grp
names(dat)<-c("x1", "x3", "y", "grp")
#actual problem
mod1<-zelig(y ~ x1 + x3 + x1:x3 +tag(1+x3|grp), model="ls.mixed", data=dat)
How to cite this model in Zelig:
Delia Bailey and Ferdinand Alimadhi. 2007. "ls.mixed: Mixed effects linear
model" in Kosuke Imai, Gary King, and Olivia Lau, "Zelig: Everyone's Statistical
Software," http://gking.harvard.edu/zelig
x<-sim(mod1)
Error in .local(object, ...) : Code not written yet
When I run it using only a random intercept (i.e. tag(1|grp)), I get a different
error after trying sim(). The new error is
Error in `[.data.frame`(x, , fTermsNames) : undefined columns selected
Thanks for any help or suggestions.
Michael Donnelly
-
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 program information: http://gking.harvard.edu/zelig/
Hey All,
I was wondering if anyone had some sample code for running
clustered standard errors for a logit in zelig. The manual says this
is possible, but every time I try to specify the cluster variable the
arguement comes back as unused, and I get the same model as if I
hadn't specifed anything. Right now I'm running something along the
lines of:
model1 <- zelig (DV ~ IVs , model="logit", robust=TRUE", data= mi(datasets))
How do you indicate a cluster?
Alex
-
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 program information: http://gking.harvard.edu/zelig/
Hi Zelig users,
I'm running some tobit models and trying to obtain the predicted values. I
try the command z.out$fitted.values (the same command I've used to obtain
fitted values for OLS, for instance), and receive the message:
> z.out1$fitted.values
NULL
Is there any command to get predicted values from a tobit model?
Best,
Fabrício Mendes Fialho
site: sites.google.com/site/fabriciofialho/
e-mail: fabriciofialho(a)gmail.com