You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
zelig does not return the model frame, which causes plot to fail:
m0<- lm(mpg~hp*am, data=mtcars)
m1<- zelig(mpg~hp*am, model="ls", data=mtcars, cite=FALSE)
plot(m0) #diagnostic plots
plot(m1) #does not work: Error in eval(predvars, data, env) : invalid 'envir' argumentm1$result$model<-m0$model
plot(m1)# works
So plot appears to fail because the model component of the lm results list is not available. This should be added so that plot and other methods that depend on the model component of the list will work correctly.
This is with Zelig version 4.1-2
The text was updated successfully, but these errors were encountered:
I just ran into the same problem. My code including the plot(z.out1) command returns the error "Error in eval(predvars, data, env) : invalid 'envir' argument of type 'closure'". The fix above does not work for me because I am letting Zelig estimate robust standard errors.
Is there any general fix yet? How can I alternatively produce the diagnostic plots from the z.out1-object?
Any quick responses are highly appreciated as I only ran into this now and need to turn in my thesis by tomorrow. Thank you!
mydata2$dlhs3_anc_gov<-ifelse(mydata2$dlhs3_anc_gov<=1,mydata2$dlhs3_anc_gov,NA)
fm3<-logit(dlhs3_anc_gov)~death0406_av+lnpcgdp0405+ln_totalpop+URBANISATION+totalliteracyrate+CST_percent+dlhs2_anc_gov
z.out3<-zelig(fm3,model="ls",data=mydata2,robust=TRUE)
summary(z.out1) #runs without a problem
plot(z.out1) #returns Error in eval(predvars, data, env) : invalid 'envir' argument of type 'closure
zelig does not return the model frame, which causes plot to fail:
So plot appears to fail because the model component of the lm results list is not available. This should be added so that plot and other methods that depend on the model component of the list will work correctly.
This is with Zelig version 4.1-2
The text was updated successfully, but these errors were encountered: