Hello,I have estimated a logistic regression model with Zelig using the mi
command to combine multiple imputed datasets. I understand that the summary
output is the combined result and that I can also print out individual
results by dataset. However, in calculating predicted probabilities, I am
wondering which coefficients are being used by Zelig - would these be from
the combined results? In addition, when setting the independent variables
to their means (setx command) - would this be some weighted mean of that
variable across those five datasets? Finally, could someone clarify the
difference between the expected values and the predicted values that are
given in the output.
Thank you,
Amber Wichowsky
University of Wisconsin-Madison
Hi everyone,
The first bugfix release of Zelig version 3.1 (Zelig_3.1-1) is online.
What's new?
- Improved the code and documentation for *.mixed models(thanks to Gregor Gorjanc)
- Fixed sur, twosls, threesls models which had problems due to some api changes in the last version of "systemfit" (see http://www.systemfit.org/)
- Added some other models (including *.mixed models) in plot.ci
- etc.
To update/install this release:
- *nix / windows users:
install.packages("Zelig", repos="http://gking.harvard.edu" <http://gking.harvard.edu%22>)
- mac users:
install.packages("Zelig", repos="http://gking.harvard.edu"
<http://gking.harvard.edu%22>, type="source")
Please let us know if you run into problems.
thanks,
Ferdi
All,
I am new to Zelig. I am trying to build a ARIMA(2,0,2) model for my
analysis. The command I used is:
ngccret_arima <- zelig(Diff(ngccret, 0)~lag.y(2)+lag.eps(2), model="arima",
data=ngccret)
I got the error message:
Error in eval(parse(text = unlist(strsplit(deparse(mf[[2]][[3]],
width.cutoff = 500), :
numeric 'envir' arg not of length one
Here ngccret is a vector of 2010X1.
I searched the mailing-list and did not find anything related postings.
Your help will be greatly appreciated.
Thank you.
--
John Li
Hi Casey,
It looks like that the current infrastructure of Zelig does not allow
the simultaneous use of "by" command with multiple imputation... We hope
to figure that out in the future though.
Sorry!
Kosuke
On Wed, 13 Feb 2008, Casey Klofstad wrote:
> Ok, here is the code and what happens:
>
> z.out <- zelig(civtotw2 ~ treat + civtotw1 + dcode1 + dcode3 + dcode4
> + dcode5 + dcode6 + dcode7 + dcode8 + dcode9 + dcode10 + dcode11 +
> dcode12 + dcode13 + dcode14 + dcode15 + dcode16, weights="weights",
> data = mi(ds1, ds2, ds3, ds4, ds5), model = "ls", by = "civw1_q")
>
> #this ran successfully; note that the "civw1_q" factor is an ordinal
> four-point scale
>
> x.untreat <- setx(z.out, treat = 0)
>
> #this also ran successfully
>
> untreat.out <- sim(z.out, x = x.untreat)
>
> #this failed; here is the traceback:
>
> 9: stop("incompatible arguments")
> 8: mvrnorm(num, mu = coef(object), Sigma = vcov(object))
> 7: param.lm(object[[i]], num = numM, bootstrap = bootstrap)
> 6: param(object[[i]], num = numM, bootstrap = bootstrap)
> 5: MIsimulation(object, num, prev, bootstrap, bootfn = bootfn, x = x,
> x1 = x1, ...)
> 4: sim.setx.MI(object[[i]], x = x[[i]], x1 = x1[[i]], num = numN,
> bootstrap = bootstrap, ...)
> 3: sim(object[[i]], x = x[[i]], x1 = x1[[i]], num = numN, bootstrap =
> bootstrap, ...)
> 2: sim.setx.strata(z.out, x = x.untreat)
> 1: sim(z.out, x = x.untreat)
>
> I get the same problem even if I don't weight the data.
>
> Another complication (or bit of evidence) is after I ran the above, I
> ran a piece of code that should work. It is the same model, onyl
> without the "by" command. The model runs fine, but when I get to
> "setx" I get this:
>
> Error in value[[jj]][ri] <- if (is.factor(xij)) as.vector(xij) else
> xij : nothing to replace with
>> traceback()
> 4: rbind(deparse.level, ...)
> 3: rbind(dta, tmp)
> 2: setx.MI(z.out, treat = 0)
> 1: setx(z.out, treat = 0)
>
> If I close R and rerun the above, it works.
>
> Thoughts? Thanks!
>
> -c
>
> On Feb 13, 2008 2:03 PM, Olivia Lau <olau(a)fas.harvard.edu> wrote:
>> Casey, after the sim command (when you get the error),
>>
>> can you tell me the output you get when you do:
>>
>> traceback()
>>
>> ?
>>
>> Also, try it without weights. Thx, O
>>
>>
>>
>> On Feb 13, 2008 11:05 AM, Casey Klofstad <klofstad(a)gmail.com> wrote:
>>
>>> Yeah, the demo works for me too.
>>>
>>> Here is what I am trying to run:
>>>
>>> #START CODE
>>>
>>> z.out <- zelig(civtotw2 ~ treat + civtotw1 + dcode1 + dcode3 + dcode4
>>> + dcode5 + dcode6 + dcode7 + dcode8 + dcode9 + dcode10 + dcode11 +
>>> dcode12 + dcode13 + dcode14 + dcode15 + dcode16, weights="weights",
>>> data = mi(ds1, ds2, ds3, ds4, ds5), model = "ls", by = "civw1_q")
>>>
>>> x.untreat <- setx(z.out, treat = 0)
>>>
>>> x.treat <- setx(z.out, treat = 1)
>>>
>>> #note: the code appears to work fine until I get to the "sim" stage;
>>> that is where I get the error "Error in mvrnorm(num, mu =
>>>
>>> coef(object), #Sigma = vcov(object)) : incompatible arguments"
>>>
>>> untreat.out <- sim(z.out, x = x.untreat)
>>>
>>> treat.out <- sim(z.out, x = x.treat)
>>>
>>> FD.out <-sim(z.out, x = x.untreat, x1 = x.treat)
>>>
>>> #END CODE
>>>
>>> I'm sure I'm missing something obvious here, so thanks very much for
>>> your indulgence.
>>>
>>> Best,
>>>
>>> -c
>>>
>>>
>>>
>>>
>>> On Feb 13, 2008 10:56 AM, Kosuke Imai <kimai(a)princeton.edu> wrote:
>>>> demo(strata) works for us and so maybe you can send us the code so that
>> we
>>>> can see what the problem is?
>>>>
>>>> Thanks,
>>>> Kosuke
>>>>
>>>>
>>>> On Wed, 13 Feb 2008, Casey Klofstad wrote:
>>>>
>>>>> I'm using simple OLS. Also, I just updated from 3.0-6 to 3.1-0. That
>>>>> does not appear to fix the issue.
>>>>>
>>>>> Is it just the case that I can't run "sim" on a series of models that
>>>>> were generated with the "by" command? Or am I missing something here?
>>>>>
>>>>> Thanks much,
>>>>>
>>>>> -c
>>>>>
>>>>> On Feb 12, 2008 11:07 PM, Kosuke Imai <kimai(a)princeton.edu> wrote:
>>>>>> Which model are you using? Also, did you try the latest release?
>>>>>>
>>>>>> Kosuke
>>>>>>
>>>>>>
>>>>>> On Tue, 12 Feb 2008, Casey Klofstad wrote:
>>>>>>
>>>>>>> I am able to estimate my model using the "by" command in zelig to
>> run
>>>>>>> a model n times for n different values of a variable of interests. I
>>>>>>> am also able to then run "setx" without any errors.
>>>>>>>
>>>>>>> The problem comes when I try to run "sim." I get the error: "Error
>> in
>>>>>>> mvrnorm(num, mu = coef(object), Sigma = vcov(object)) : incompatible
>>>>>>> arguments."
>>>>>>>
>>>>>>> Maybe I am missing something obvious here. Thoughts?
>>>>>>>
>>>>>>> Thanks much!
>>>>>>>
>>>>>>> -c
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Casey A. Klofstad
>>> University of Miami
>>> Department of Political Science
>>> Coral Gables, FL
>>>
>>> klofstad(a)gmail.com
>>> http://moya.bus.miami.edu/~cklofstad
>>>
>>
>>
>
>
>
>
-
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/
Hi,
Does anyone have any thoughts on Bayesian Model Averaging as an
approach to estimating a summary treatment effect? Or a different
approach? I would like to incorporate treatment effects obtained
through models from the survival and logit classes and from a variety
of specifications within those classes (both from before and after
matching).
Thanks.
Sincerely,
Andy Stokes
Institute for Health Metrics and Evaluation
-
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 able to estimate my model using the "by" command in zelig to run
a model n times for n different values of a variable of interests. I
am also able to then run "setx" without any errors.
The problem comes when I try to run "sim." I get the error: "Error in
mvrnorm(num, mu = coef(object), Sigma = vcov(object)) : incompatible
arguments."
Maybe I am missing something obvious here. Thoughts?
Thanks much!
-c
--
Casey A. Klofstad
University of Miami
Department of Political Science
Coral Gables, FL
klofstad(a)gmail.com
http://moya.bus.miami.edu/~cklofstad
-
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/
Hi there,
My ultimate goal is to produce a plot of effect sizes associated with
the treatment across a range of models. I am translating all results
into relative risks with 95% confidence intervals. When you run a
duration dependent model using the exponential survival distribution
and obtain hazard ratios, have you thus obtained the quantity of
interest? Using Zelig in the Logit framework, for example, I set
values of X and ran simulation to obtain relative risks. But in the
survival framework, it appears that simply through regression, you
obtain the analogous quantity. Is there any benefit in using Zelig to
run simulations in this case?
Best Regards,
Andy Stokes
Institute for Health Metrics and Evaluation
-
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/
f6f-
" <shigesong(a)gmail.com>
CC: zelig(a)lists.gking.harvard.edu
Subject: Re: [zelig] After nonparametric preprocessing...
References: <5abc11d80802010453m714cbcf9u3e5dd1a79ef95e7(a)mail.gmail.com>
In-Reply-To: <5abc11d80802010453m714cbcf9u3e5dd1a79ef95e7(a)mail.gmail.com>
X-Spam-HMDC: YES
Sender: owner-zelig_at_lists_gking_harvard_edu(a)mail.hmdc.harvard.edu
Precedence: bulk
List-Unsubscribe:
<mailto:majordomo@mail.hmdc.harvard.edu?body=unsubscribe%20zelig_at_lists_gking_harvard_edu>
X-MajorDomo: zelig_at_lists_gking_harvard_edu
X-Mime-Autoconverted: from 8bit to 7bit by courier 0.55
good morning,
if what you're modeling varies across siblings, there are better ways to
use information on siblings.
whatis the "treatment"/
thanks,
michael
e.f6f- wrote:
> Dear Colleagues,
>
> I am studying women's fertility behaviours in China. In my data, each
> women can have up to nine births. A multilevel model with children
> nested within women seems to be an ideal solution. In order to reduce
> model dependence, I preprocessed the data using nearest neighbour
> method. Sine the number of the "treated" case is relatively small
> (10%), even with the ratio set to 2, the sample size of the matched
> data reduced drastically and damaged the multilevel structure. Now
> most of women in the matched sample has only one child left. My
> question is: does it still make sense to estimate a multilevel or
> mixed model instead of a plain OLS regression or logistic regression?
> Further, are there good references on propensity score matching in a
> multilevel situation?
>
> Best,
> Shige
--
E. Michael Foster
getmike.info
download vcard: www dot unc dot edu/~emfoster/Foster.vcf
Professor of Maternal and Child Health
of Health Policy and Administration
of Biostatistics (adjunct)
Associate Chair for Faculty Advancement
(W) 919-966-3773
(F) 919-966-0458
Office: 407C Rosenau Hall << use for FEDEX
School of Public Health
University of North Carolina, Chapel Hill
Rosenau Hall, Campus Box# 7445
Chapel Hill, NC 27599-7445
[the http is throwing off some spam filters)
visit the new FAQ section of my blog:
fosterfaq dot blogspot dot com
27) [Mollie Ivins] "What do you mean cancer is a gift. You're as a dumb as Shrub. Cancer just killed me. Some gift."
"I'm not quite dead yet, sir!" -- Concorde, Monty Python and the Holy Grail
29) Feeling middle-aged? I've got the answer. 8-)
-
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/
To Whom this may Concern
Hi there, I have tried using the multinomial logistic
regression (mlogit) to estimate the model in zelig from the imputed data m=5
from Amelia. I actually have to compare the predicted value from the mlogit
model vs the training set from the data i have.(Im using the data from data
mining cup 2004 for my bacholor project). I know that sim() would generate
the predicted value by inputting the parameter of x.out and z.out. Then can
i actually compare the predicted value from sim() directly to the training
set i have to check the accuracy? since the parameter did not require any
data sets, or did it acquire the data from either x.out or z.out? then Later
on i have to use the model from the zelig to apply to the tester set, while
predict() that can input the model and the data won't work on zelig. how
exactly can i use the model from zelig to apply to the tester set here and
find accuracy? Many thanks
Thank You
A. Homtientong