-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
weights parameter breaks the use of the summary method.
Example:
#poisson
obj <- zelig(treat~black+married, model = "poisson", robust=list(method="weave"), data = lalonde)
summary(obj)
exp(1.956)#7.070986 quite different results
#In my data, the results are even more striking when including a covariate
#(as for "married" here, my covariate is a binary variable and setx is taking the "mean", taking the mode gives even more different results)
#SECOND PROBLEM: fitting poisson model with robust standard error and weight
length(lalonde$treat)
#creation of false weights
lalonde$w=c(rep(1,300),rep(2,314))
#fit
obj <- zelig(treat~black+married, model = "poisson", robust=list(method="weave"), weights="w",data = lalonde)
summary(obj)
#ERROR message:
#Error in model.frame.default(formula = treat ~ black + married, data = lalonde, :
#variable lengths differ (found for '(weights)')
#I need to do that with imputed data so that it should work with the following syntax
#creation of "new" data-frame
lalonde1=lalonde
lalonde1$w=c(rep(0,100),rep(1,214),rep(2,300))
obj <- zelig(treat~black+married, model = "poisson", robust=list(method="weave"), weights="w",data = mi(lalonde,lalonde1))
summary(obj)