Hey Kosuke-
"polact" is created with:
ds1$polact <- (ds1$q12_a + ds1$q12_b + ds1$q12_c + ds1$q12_d)
ds2$polact <- (ds2$q12_a + ds2$q12_b + ds2$q12_c + ds2$q12_d)
ds3$polact <- (ds3$q12_a + ds3$q12_b + ds3$q12_c + ds3$q12_d)
ds4$polact <- (ds4$q12_a + ds4$q12_b + ds4$q12_c + ds4$q12_d)
ds5$polact <- (ds5$q12_a + ds5$q12_b + ds5$q12_c + ds5$q12_d)
What other error are you getting?
Best,
-c
On Wed, Mar 4, 2009 at 9:44 PM, Kosuke Imai <kimai(a)princeton.edu> wrote:
now i'm getting an error because there is no "polact" variable. also, the
code you gave me yields an error too...
Kosuke
--
Department of Politics
Princeton University
http://imai.princeton.edu
On Tue, 3 Mar 2009, Casey Klofstad wrote:
> Sorry, here's the code for that:
>
> ds1$econview <- (ds1$q18+ds1$q19+ds1$q20)/3
> ds2$econview <- (ds2$q18+ds2$q19+ds2$q20)/3
> ds3$econview <- (ds3$q18+ds3$q19+ds3$q20)/3
> ds4$econview <- (ds4$q18+ds4$q19+ds4$q20)/3
> ds5$econview <- (ds5$q18+ds5$q19+ds5$q20)/3
>
> Also, I've attached the entire code file I've been using in case I
> forgot to add any other variables to the truncated version I sent you.
>
> Thanks!
>
> -c
>
> On Mon, Mar 2, 2009 at 10:37 PM, Kosuke Imai <kimai(a)princeton.edu>
> wrote:
>>
>> I started looking at this but I get an error because there is no
>> "econview"
>> in ds5.
>>
>> Kosuke
>>
>> --
>> Department of Politics
>> Princeton University
>>
http://imai.princeton.edu
>>
>> On Wed, 25 Feb 2009, Casey Klofstad wrote:
>>
>>> Here you go. The zip file contains 5 imputed data sets and a code
>>> file. The code file takes you though matching to the analysis
>>> problems. I'm sure I've just missed soemthing obvious, but who
knows.
>>>
>>> Thanks VERY much!
>>>
>>> Best,
>>>
>>> -c
>>>
>>> On Wed, Feb 25, 2009 at 5:08 PM, Kosuke Imai <kimai(a)princeton.edu>
>>> wrote:
>>>>
>>>> hmmm... can you send me the data set if you don't mind? also a few
>>>> lines
>>>> of
>>>> your code so that I can replicate your error?
>>>>
>>>> Thanks,
>>>> Kosuke
>>>>
>>>> --
>>>> Department of Politics
>>>> Princeton University
>>>>
http://imai.princeton.edu
>>>>
>>>> On Wed, 25 Feb 2009, Casey Klofstad wrote:
>>>>
>>>>> I just tried this and I get the same error:
>>>>>
>>>>> Error in model.frame.default(formula = polact ~ treat, data = list(X
>>>>> =
>>>>> 1:2399, :
>>>>> variable lengths differ (found for '(weights)')
>>>>>
>>>>> Best,
>>>>>
>>>>> -c
>>>>>
>>>>> On Tue, Feb 24, 2009 at 5:13 PM, Kosuke Imai
<kimai(a)princeton.edu>
>>>>> wrote:
>>>>>>
>>>>>> Can you try paste this and then run the negbin model you had a
>>>>>> trouble
>>>>>> with?
>>>>>>
>>>>>> zelig2negbin <- function(formula, model, data, M, ...) {
>>>>>> mf <- match.call(expand.dots = TRUE)
>>>>>> mf$model <- mf$M <- mf$robust <- NULL
>>>>>> mf[[1]] <- MASS::glm.nb
>>>>>> if (is.character(mf$weights))
>>>>>> mf$weights <- as.name(mf$weights)
>>>>>> as.call(mf)
>>>>>> }
>>>>>>
>>>>>> Thanks,
>>>>>> Kosuke
>>>>>>
>>>>>> --
>>>>>> Department of Politics
>>>>>> Princeton University
>>>>>>
http://imai.princeton.edu
>>>>>>
>>>>>> On Tue, 24 Feb 2009, Casey Klofstad wrote:
>>>>>>
>>>>>>> Hey Kosuke-
>>>>>>>
>>>>>>> Thanks for the response.
>>>>>>>
>>>>>>> I tried this and I still get the same error with just one
ds.
>>>>>>> Also,
>>>>>>> I
>>>>>>> note that I have the same problem with negbin, but not
poisson.
>>>>>>>
>>>>>>> ??!?!?
>>>>>>>
>>>>>>> Best,
>>>>>>>
>>>>>>> -c
>>>>>>>
>>>>>>> On Tue, Feb 24, 2009 at 3:56 PM, Kosuke Imai
<kimai(a)princeton.edu>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Does the same command work on one of the imputed data
sets
>>>>>>>> without
>>>>>>>> mi()?
>>>>>>>>
>>>>>>>> Kosuke
>>>>>>>>
>>>>>>>> --
>>>>>>>> Department of Politics
>>>>>>>> Princeton University
>>>>>>>>
http://imai.princeton.edu
>>>>>>>>
>>>>>>>> On Tue, 24 Feb 2009, Casey Klofstad wrote:
>>>>>>>>
>>>>>>>>> Hey all-
>>>>>>>>>
>>>>>>>>> I posted the below onthe Zelig discussion board, but
I think
>>>>>>>>> this
>>>>>>>>> might also be related to MatchIt:
>>>>>>>>>
>>>>>>>>> I just weighted some data, and am trying to examine
the results
>>>>>>>>> with
>>>>>>>>> ordered logit. The code is:
>>>>>>>>>
>>>>>>>>> z.out <- zelig(as.factor(polact) ~ treat,
weights="weights",
>>>>>>>>> data
>>>>>>>>> =
>>>>>>>>> mi(ds1, ds2, ds3, ds4, ds5), model =
"ologit")
>>>>>>>>>
>>>>>>>>> This produces the error:
>>>>>>>>>
>>>>>>>>> Error in model.frame.default(formula =
as.factor(polact) ~
>>>>>>>>> treat,
>>>>>>>>> data
>>>>>>>>> =
>>>>>>>>> list( :
>>>>>>>>> variable lengths differ (found for
'(weights)')
>>>>>>>>>
>>>>>>>>> The same weighted model above runs fine in OLS, and I
am running
>>>>>>>>> MatchIt Version 2.4-10 (downloaded from Gary
King's website).
>>>>>>>>>
>>>>>>>>> Thoughts?
>>>>>>>>>
>>>>>>>>> Thanks much,
>>>>>>>>>
>>>>>>>>> -c
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>
>
>
>