There are two problems. "weight" should be "weights" (you need
"s"), and
also the variable name needs to have quotations. in your example, you need
summary(zelig(y~x,data=X,model="ls",weights="weight1"))
rather than
summary(zelig(y~x,data=X,model="ls",weight=weight1))
Hope this helps,
Kosuke
-----------------------------------------------------
Kosuke Imai Office: Corwin Hall 041
Assistant Professor Phone: 609-258-6601
Department of Politics eFax: 973-556-1929
Princeton University Email: kimai(a)Princeton.Edu
Princeton, NJ 08544-1012
http://imai.princeton.edu
-----------------------------------------------------
On Thu, 13 Sep 2007, Eduardo Leoni wrote:
> Hello again -
>
> I am still having problems with the weight argument. For example
>
> library(Zelig)
> X <- data.frame(x=rnorm(100),y=rnorm(100),weight1=runif(100,0.5,2))
> summary(zelig(y~x,data=X,model="ls"))
> ##wworks
summary(zelig(y~x,data=X,model="ls",weight=weight1))
> ## doesn't
work. Why? The lm code works:
> summary(lm(y~x,data=X,weight=weight1))
> ## but this works
> summary(zelig(y~x,data=X,model="ls",weight=X$weight1))
> ## then again if missing values are present
> X[10,"x"] <- NA
> ## it doesn't work any longer
> summary(zelig(y~x,data=X,model="ls",weight=X$weight1))
>
> thanks,
>
> -eduardo
>
> -
> 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/
>
-
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/