Hi. I am trying to estimate a bivariate probit model in Zelig. My data
comes from a stratified sample, so I would like to assign different
weights to each observation. I cannot figure out how to do this, and I
am hoping I could get some guidance.
Thanks,
Michael
--
Michael Braun
Assistant Professor of Marketing
MIT Sloan School of Management
One Amherst St., E40-169
Cambridge, MA 02142
USA
braunm(a)mit.edu
+1 (617) 253-3436
-
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/
I am trying to install Zelig (>=3.0.3) under Linux. It does not appear to
be available anywhere. The commands:
> source("http://gking.harvard.edu/zelig/install.R")
> install.packages("Zelig",repos="http://gking.harvard.edu")
> install.packages("Zelig")
.all give me the same error message:
Warning in download.packages(unique(pkgs), destdir = tmpd, available =
available, :
no package 'Zelig' at the repositories
What am I doing wrong?
Thanks for your help.
Michael
Michael Braun
Assistant Professor of Marketing
MIT Sloan School of Management
One Amherst St., E40-169
Cambridge, MA 02142
(617) 253-3436
braunm(a)mit.edu
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/
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 program information: http://gking.harvard.edu/zelig/
>