Rod Alence | 15 May 2013 11:49
Picon
Favicon

problem with logical x-variable

Hi,

I was just running an old script, and some Zelig commands that used to work are not working anymore (in Zelig 4.1-3).

The problem is with including a logical vector as an x-variable.  The zelig() function works properly (with the logical vector treated as a 0:1 dummy).  Things break down in setx(), which doesn't seem to convert the logical values into their numerical equivalents, resulting in a "model matrix" that is NA (and a "non-comformable arguments" error when fed to sim()).

A workaround is to enter the numerical equivalents of TRUE and FALSE in setx(), but it would be more intuitive to be able to enter the logical values directly, as in the past.

(Minimal working example below.)

Rod

## Minimal working example -- Zelig problem with logical x
require(Zelig)
df <- data.frame(y=rnorm(20),
                 xLogical=sample(c(TRUE, FALSE),
                   size=20,
                   replace=TRUE))
z.out <- zelig(y ~ xLogical, data=df, model="ls")
x.out <- setx(z.out, xLogical=FALSE)
summary(x.out)             # model matrix is NA
s.out <- sim(z.out, x.out) # error: non-conformable arguments

## Workaround
x.out2 <- setx(z.out, xLogical=0)
summary(x.out2)            # model matrix is OK
s.out <- sim(z.out, x.out2)
summary(s.out)           


This communication is intended for the addressee only. It is confidential. If you have received this communication in error, please notify us immediately and destroy the original message. You may not copy or disseminate this communication without the permission of the University. Only authorised signatories are competent to enter into agreements on behalf of the University and recipients are thus advised that the content of this message may not be legally binding on the University and may contain the personal views and opinions of the author, which are not necessarily the views and opinions of The University of the Witwatersrand, Johannesburg. All agreements between the University and outsiders are subject to South African Law unless the University agrees in writing to the contrary.
<div>
<div>Hi,<br><br>
I was just running an old script, and some Zelig commands that used to work are not working anymore (in Zelig 4.1-3).<br><br>
The problem is with including a logical vector as an x-variable.&nbsp; The zelig() function works properly (with the logical vector treated as a 0:1 dummy).&nbsp; Things break down in setx(), which doesn't seem to convert the logical values into their numerical equivalents,
 resulting in a "model matrix" that is NA (and a "non-comformable arguments" error when fed to sim()).<br><br>
A workaround is to enter the numerical equivalents of TRUE and FALSE in setx(), but it would be more intuitive to be able to enter the logical values directly, as in the past.<br><br>
(Minimal working example below.)<br><br>
Rod<br><br>## Minimal working example -- Zelig problem with logical x<br>
require(Zelig)<br>
df &lt;- data.frame(y=rnorm(20),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xLogical=sample(c(TRUE, FALSE),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size=20,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; replace=TRUE))<br>
z.out &lt;- zelig(y ~ xLogical, data=df, model="ls")<br>
x.out &lt;- setx(z.out, xLogical=FALSE)<br>
summary(x.out)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # model matrix is NA<br>
s.out &lt;- sim(z.out, x.out) # error: non-conformable arguments<br><br>
## Workaround<br>
x.out2 &lt;- setx(z.out, xLogical=0)<br>
summary(x.out2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # model matrix is OK<br>
s.out &lt;- sim(z.out, x.out2)<br>
summary(s.out)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br><br>
</div>
<table><tr><td bgcolor="#ffffff"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
<td align="left"><span>This communication is intended for the addressee only. It is confidential. If you have received this communication in error, please notify us immediately and destroy the original message. You may not copy or disseminate this communication without the permission of the University. Only authorised signatories are competent to enter into agreements on behalf of the University and recipients are thus advised that the content of this message may not be legally binding on the University and may contain the personal views and opinions of the author, which are not necessarily the views and opinions of The University of the Witwatersrand, Johannesburg. All agreements between the University and outsiders are subject to South African Law unless the University agrees in writing to the contrary. </span></td>
</tr></table></td></tr></table>
</div>
Cesar Zucco | 15 May 2013 21:28
Picon

can't invoke data object inside a function

Hello list,

Is there any known issue using Zelig (4.1-3) commands  inside a function and invoking data.frame that is only defined inside that functionThis worked in the previous versions of Zelig, and works with non-zelig commands. Here's a barebones example:

my.function <- function(the.data){
lcl.data <- subset(the.data,select=c(dv,iv))
reg <- lm(dv~ iv,data=lcl.data) #this works fine 
zelig.reg <- zelig(dv~ iv,data=lcl.data,model="ls") #this gives error
}

The lm regression works, but no zelig model seems to be able to use the lcl.data. I get the same error message triggered by invoking a data.frame that does not exist:

Error in multi.dataset(lcl.data) : object 'lcl.data' not found

cz

Cesar Zucco Jr.
Assistant Professor
Political Science Department
Rutgers, The State University of New Jersey
http://fas-polisci.rutgers.edu/zucco/




<div>
<div>Hello list,</div>
<div><br></div>
<div>Is there any known issue using&nbsp;<span>Zelig</span>&nbsp;<span>(</span><span>4.1</span><span>-</span><span>3</span><span>)</span>&nbsp;commands&nbsp;<span>&nbsp;</span>inside a function and invoking data.frame<span>&nbsp;</span>that<span>&nbsp;</span>is<span>&nbsp;</span>only defined inside that function<span>?&nbsp;</span>This<span>&nbsp;</span>worked&nbsp;<span>in</span>&nbsp;the previous versions of Zelig<span>, and works with non-zelig commands.&nbsp;</span>Here<span>'s a barebones example:</span>
</div>
<div><br></div>
<div>my.function &lt;- function(the.data){</div>
<div>
<span class="Apple-tab-span">	</span>lcl.data &lt;- subset(the.data,select=c(dv,iv))</div>
<div>
<span class="Apple-tab-span">	</span>reg &lt;- lm(dv~ iv,data=lcl.data) #this works fine&nbsp;<span class="Apple-tab-span">	</span>
</div>
<div>
<span class="Apple-tab-span">	</span>zelig.reg &lt;- zelig(dv~ iv,data=lcl.data,model="ls") #this gives error</div>
<div>}</div>
<div><br></div>
<div>The lm regression works, but no zelig model seems to be able to use the lcl.data. I get the same error message triggered by&nbsp;invoking a data.frame that does not exist:</div>
<div><br></div>
<div>Error in multi.dataset(lcl.data) : object '<span>lcl.data</span>' not found</div>
<div><br></div>
<div>cz</div>
<div><br></div>
<div apple-content-edited="true"><span class="Apple-style-span">Cesar Zucco Jr.<br>Assistant Professor<br>Political Science Department<br>Rutgers, The State University of New Jersey<br><a href="http://fas-polisci.rutgers.edu/zucco/">http://fas-polisci.rutgers.edu/zucco/</a><br></span></div>
<div apple-content-edited="true"><br></div>
<div apple-content-edited="true">
<span class="Apple-style-span"><br><br></span>

</div>
<br>
</div>
Rogério Barbosa | 10 May 2013 15:17
Picon

Re: Weighted Multinomial Logistic

Hi Matt, (cc Zelig List)

After a long time, I'm writing  to you again... concerning to the same issue. Just recalling: I needed to use weights in a mlogit model. By the time Zelig's multinomial function was that one from "Multinomial" package. I was trying to implement mlogit function from VGAM (vglm) into Zelig through zelig2. But my dead line was close... so I gave up trying to figure out how to do that at that time. 

It seems now Zelig uses exactly the function from VGAM. And vglm allows weights. So I runned two mlogit models. See below:

###########################################
library(Zelig)
library(ZeligChoice)

z.out1 = zelig(as.factor(vote88)~pristr + othcok, model="mlogit", data=mexico)
z.out2 = zelig(as.factor(vote88)~pristr + othcok, model="mlogit", weights=~age,data=mexico)  #age is being  used as weights just for the sake of example
summary(z.out1)
summary(z.out2)

###########################################


The results of the two model are exactly the same. In other words, the weights are not working. Am I getting something wrong?



thanks for you attention and help,
best regards,
----
Rogério Jerônimo Barbosa
Sociology PhD Student at USP - São Paulo, Brazil
Researcher at Center for Metropolitan Studies (Cem/Cebrap)





On Mon, Sep 17, 2012 at 4:21 PM, Matt Owen <mowen-zvdtVsPQyYJu6/7BKvT5pw@public.gmane.org> wrote:
Can you give a particular example of what you are trying to accomplish?

I ran the following (as a test) with no issue:

library(Zelig)
data(mexico)
zelig(as.factor(vote88) ~ pristr + othcok + othsocok, model = "mlogit", weights = 1:10, data = mexico[1:10, ])

On Sep 17, 2012, at 11:25 AM, Rogério Barbosa wrote:

Hey Matt, 

Is it possible to use Zelig2 to implement vglm, as I was trying to do? If yes, how can it be done?

Best,
R.

On Mon, Sep 17, 2012 at 12:03 PM, Matt Owen <mowen-zvdtVsPQyYJu6/7BKvT5pw@public.gmane.org> wrote:
Zelig's "mlogit" currently does not support the weights parameter. This has been added as a feature request here:
  https://github.com/zeligdev/ZeligMultinomial/issues/1


On Sep 17, 2012, at 10:54 AM, Rogério Barbosa wrote:

Hi,

I'm trying to run a weighted multinomial logistic -- but "mlogit" family doesn't allow weights... I tryed to implement an external function from VGAM package not multinomial() -- which seems to be the Zelig's built-in; but vglm() ] using Zelig2... But I'm couldn't make it work.

Is there any other way to use weights in a mlogit?

thanks,
Rogério J. Barbosa
Researcher at Centre for Metropolitan Studies/Cebrap
São Paulo - Brazil -
--
Zelig Mailing List, served by HUIT
Send messages: zelig-boHuZhbfW+Y6DHxCPSz5rL5+avTOL6Rl@public.gmane.org
[un]subscribe Options: http://lists.gking.harvard.edu/mailman/listinfo/zelig
Zelig program information: http://gking.harvard.edu/zelig/
Zelig mailing list
Zelig <at> lists.gking.harvard.edu
https://lists.gking.harvard.edu/mailman/listinfo/zelig




<div>
<div dir="ltr">Hi Matt, (cc Zelig List)<div><br></div>
<div>After a long time, I'm writing &nbsp;to you again... concerning to the same issue. Just recalling: I needed to use weights in a mlogit model. By the time Zelig's multinomial function was that one from "Multinomial" package. I was trying to implement mlogit function from VGAM (vglm) into Zelig through zelig2. But my dead line was close... so I gave up trying to figure out how to do that at that time.&nbsp;</div>

<div><br></div>
<div>It seems now Zelig uses exactly the function from VGAM. And vglm allows weights. So I runned two mlogit models. See below:</div>
<div><br></div>
<div>###########################################<br>
</div>
<div>
<div>library(Zelig)</div>
<div>library(ZeligChoice)</div>
<div><br></div>
<div>z.out1 = zelig(as.factor(vote88)~pristr + othcok, model="mlogit", data=mexico)</div>
<div>z.out2 = zelig(as.factor(vote88)~pristr + othcok, model="mlogit", weights=~age,data=mexico) &nbsp;#age is being &nbsp;used as weights just for the sake of example</div>

<div>summary(z.out1)</div>
<div>summary(z.out2)</div>
</div>
<div><br></div>
<div>###########################################<br>
</div>
<div><br></div>
<div><br></div>
<div>The results of the two model are exactly the same. In other words, the weights are not working. Am I getting something wrong?</div>

<div><br></div>
<div><br></div>
<div><br></div>
<div>thanks for you attention and help,</div>
<div>best regards,</div>
<div>
<div>----</div>
<div>Rog&eacute;rio Jer&ocirc;nimo Barbosa</div>
<div>Sociology PhD Student at USP - S&atilde;o Paulo, Brazil</div>

<div>Researcher at Center for Metropolitan Studies (Cem/Cebrap)</div>
</div>
<div><br></div>
<div><br></div>
<div><br></div>
</div>
<div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Sep 17, 2012 at 4:21 PM, Matt Owen <span dir="ltr">&lt;<a href="mailto:mowen@...rvard.edu" target="_blank">mowen@...</a>&gt;</span> wrote:<br><blockquote class="gmail_quote"><div>Can you give a particular example of what you are trying to accomplish?<div><br></div>

<div>I ran the following (as a test) with no issue:</div>
<div><br></div>
<div>library(Zelig)</div>
<div>data(mexico)</div>
<div>zelig(as.factor(vote88) ~ pristr + othcok + othsocok, model = "mlogit", weights = 1:10, data = mexico[1:10, ])</div>

<div><div class="h5"><div>
<br><div>
<div>On Sep 17, 2012, at 11:25 AM, Rog&eacute;rio Barbosa wrote:</div>
<br><blockquote type="cite">Hey Matt,&nbsp;<div><br></div>
<div>Is it possible to use Zelig2 to implement vglm, as I was trying to do? If yes, how can it be done?</div>

<div><br></div>
<div>Best,</div>
<div>R.<br><br><div class="gmail_quote">On Mon, Sep 17, 2012 at 12:03 PM, Matt Owen <span dir="ltr">&lt;<a href="mailto:mowen@..." target="_blank">mowen@...</a>&gt;</span> wrote:<br><blockquote class="gmail_quote"><div>Zelig's "mlogit" currently does not support the weights parameter. This has been added as a feature request here:<div>

&nbsp;&nbsp;<a href="https://github.com/zeligdev/ZeligMultinomial/issues/1" target="_blank">https://github.com/zeligdev/ZeligMultinomial/issues/1</a><br><div><br></div>
<div>
<br><div>
<div><div>
<div>On Sep 17, 2012, at 10:54 AM, Rog&eacute;rio Barbosa wrote:</div>

<br>
</div></div>
<blockquote type="cite">
<div><div>Hi, <br><br>I'm trying to run a weighted multinomial logistic -- but "mlogit" family doesn't allow weights... I tryed to implement an external function from VGAM package not multinomial() -- which seems to be the Zelig's built-in; but vglm() ] using Zelig2... But I'm couldn't make it work. <br><br>Is there any other way to use weights in a mlogit? <br><br>thanks,<br>Rog&eacute;rio J. Barbosa<br>Researcher at Centre for Metropolitan Studies/Cebrap<br>
</div></div>S&atilde;o Paulo - Brazil
-<span><br>--<br>Zelig Mailing List, served by HUIT<br>Send messages: <a href="mailto:zelig@..." target="_blank">zelig@...</a><br>[un]subscribe Options: <a href="http://lists.gking.harvard.edu/mailman/listinfo/zelig" target="_blank">http://lists.gking.harvard.edu/mailman/listinfo/zelig</a><br>

Zelig program information: <a href="http://gking.harvard.edu/zelig/" target="_blank">http://gking.harvard.edu/zelig/</a><br>Zelig mailing list<br><a href="mailto:Zelig@..." target="_blank">Zelig <at> lists.gking.harvard.edu</a><br><a href="https://lists.gking.harvard.edu/mailman/listinfo/zelig" target="_blank">https://lists.gking.harvard.edu/mailman/listinfo/zelig</a></span>
</blockquote>
</div>
<br>
</div>
</div>
</div></blockquote>
</div>
<br>
</div>

</blockquote>
</div>
<br>
</div></div></div>
</div></blockquote>
</div>
<br>
</div>
</div>
Zsófia Ignácz | 9 May 2013 23:46
Picon
Favicon

problems when using the setx within function command

Dear Zelig Community,

I have just updated my R from version 2.13 to 3.0.0, and along with it, 
my Zelig package. I have updated my scripts according to the newest 
modifications in the Zelig and ZeligChoice package, but I stil bump into 
a problem when I try to use the setx function within an ordinary 
function command (even though it DID work under 2.13!).

My problem:
While the command lines zelig() and setx() work perfectly in a normal 
environment, once I embed the zelig() and setx() into a function() [I 
need to embed the zelig functions due to further analysis], the whole 
thing collapses. I demonstrate on the example given in ZeligChoice (see 
below), but I get the same error for my own data.

I would appreciate your help with this problem - it would be very 
important for me to get the setx and the sim into the function, so I can 
then extract the $qi$ev for some further analysis.

Thanks for your response,
Zsófia Ignácz

####This works
data(mexico)
z.out <- zelig(as.factor(vote88) ~ pristr + othcok + othsocok, model = 
"mlogit",
data = mexico)
x.weak <- setx(z.out, pristr = 1, othcok=2, othsocok=3) ###I chose the 
values without considering any substantial meaning

###This doesn't (even though technically identical)
dem.func <- function (a,b,c) {
z.out <- zelig(as.factor(vote88) ~ pristr + othcok + othsocok, model = 
"mlogit",
data = mexico)
x.weak <- setx(z.out, pristr=a,othcok=b,othsocok=c)
}
dem.func (a=1,b=2,c=3)

###Error:
Error in eval(expr, envir, enclos) : object 'a' not found

###Technical Info:
R version 3.0.0 (2013-04-03) -- "Masked Marvel"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
ZELIG (Versions 4.1-3, built: 2013-01-30)
-- 
Zsófia Ignácz
PhD Student
Humboldt Universität zu Berlin
Berlin Graduate School of Social Sciences European PhD for 
Social-economic
and Social Statistics
Email: zsofia.ignacz <at> sowi.hu-berlin.de

Research Associate
Jacobs University Bremen
Campus Ring 1
D-28759 Bremen
Germany

Phone: +49 421 200-3012
Email: z.ignacz <at> jacobs-university.de
URL: http://jacobs-university.de/directory/zignacz
-
--
Zelig Mailing List, served by HUIT
Send messages: zelig <at> lists.gking.harvard.edu
[un]subscribe Options: http://lists.gking.harvard.edu/mailman/listinfo/zelig
Zelig program information: http://gking.harvard.edu/zelig/
Zelig mailing list
Zelig <at> lists.gking.harvard.edu

To unsubscribe from this list or get other information:

https://lists.gking.harvard.edu/mailman/listinfo/zelig
Ari Friedman | 9 May 2013 00:09
Picon
Gravatar

".hook parameter must be a function" with Zelig'd negbinom model

Hi Zelig list,

    I'm trying to get Zelig up and running to to perform some
Clarify-like magic on my negative binomial regression.  Unfortunately,
while the model runs and returns a model object, it also gives the
following warning:

In z(.function = "glm.nb", .hook = "robust.glm.hook", weights = weights,  :
  .hook parameter must be a function. ignoring.

In addition to making me uneasy, there appears to be no difference
between the robust and non-robust versions of the model.

About my computer:
R 2.15.2
Zelig beta (installed today, after the released version of Zelig also
installed today returned the same warning)

Below is an example that reproduces the problem seen in my real data.

Is this just an issue with how my particular copy of R is configured,
or is there something deeper going on?  If the former, how do I fix
it?

Any tips you can provide would be most welcome.

Thanks,
Ari

data(turnout)
dat <- turnout
dat$count <- rpois( n=nrow(dat), lambda=ceil(dat$age/15) )
Zunrobust <- zelig(count ~ age, model = "negbinom", data = dat)
Zrobust <- zelig(count ~ age, model = "negbinom", data = dat, robust=TRUE)

> summary(Zrobust)

Call:
"glm.nb"(weights = weights, formula = formula, data = data, .hook =
"robust.glm.hook")

Deviance Residuals:
    Min       1Q   Median       3Q      Max
-3.1882  -0.8442  -0.0998   0.5723   3.6247

Coefficients:
             Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.3582217  0.0360647   9.933   <2e-16 ***
age         0.0184236  0.0006645  27.725   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for Negative Binomial(115.4597) family taken to be 1)

    Null deviance: 2917.6  on 1999  degrees of freedom
Residual deviance: 2164.1  on 1998  degrees of freedom
AIC: 7954.6

Number of Fisher Scoring iterations: 1

              Theta:  115
          Std. Err.:  116

 2 x log-likelihood:  -7948.563
> summary(Zunrobust)

Call:
"glm.nb"(weights = weights, formula = formula, data = data, .hook =
"robust.glm.hook")

Deviance Residuals:
    Min       1Q   Median       3Q      Max
-3.1882  -0.8442  -0.0998   0.5723   3.6247

Coefficients:
             Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.3582217  0.0360647   9.933   <2e-16 ***
age         0.0184236  0.0006645  27.725   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for Negative Binomial(115.4597) family taken to be 1)

    Null deviance: 2917.6  on 1999  degrees of freedom
Residual deviance: 2164.1  on 1998  degrees of freedom
AIC: 7954.6

Number of Fisher Scoring iterations: 1

              Theta:  115
          Std. Err.:  116

 2 x log-likelihood:  -7948.563
-
--
Zelig Mailing List, served by HUIT
Send messages: zelig <at> lists.gking.harvard.edu
[un]subscribe Options: http://lists.gking.harvard.edu/mailman/listinfo/zelig
Zelig program information: http://gking.harvard.edu/zelig/
Zelig mailing list
Zelig <at> lists.gking.harvard.edu

To unsubscribe from this list or get other information:

https://lists.gking.harvard.edu/mailman/listinfo/zelig
David Rothwell | 5 May 2013 19:33
Picon
Favicon

spline logistic regression in Zelig?


Dear Zelig listserv,

I would like to implement splines along one independent variable in a logistic regression model with
multiples IVs. I would like to establish knots at 3 different levels of one IV (e.g., low, medium, high).
I have searched online and reviewed the Zelig reference manual and cannot find any documentation for such a
procedure. I see the logit.gam procedure (12.24) incorporates knots but there is not much 
description in the manual. An example is provided from mgcv gam is:
RRR> z.out <-zelig(y~s(x0,k=4,fx=TRUE,bs="tp")+s(x1,k=12)+s(x2,k=15),
 model="logit.gam", data=my.data)
I've looked in the mgcv and gam sections and not found any examples that help with what I am trying to do. 

Questions:
1. Does the logit.gam procedure allow an equivalent to a spline regression (e.g., mkspline in stata:
http://www.stata.com/help.cgi?mkspline)? I've pasted stata code below. Or is there another Zelig
procedure you'd recommend? 
2. I see k= command and a knots = in the documentation. Are there any other examples of how to use these or where
to read more about their use? 

Much thanks for your time,

David

## stata code spline and logistic regression predicting enrollment
mkspline nw1 -8.3938 nw2 8.294 nw3 = ASSETS_LIAB_NWIHS, marginal displayknots
logistic Enroll AgeEnroll Female Married HHSize Eduy Eft Ept Estu TANFEver Home Stock CheckA SavA nw1-nw3

Honaker, James | 1 May 2013 21:11
Picon
Favicon

ZeligChoice Package Update (0.8-0)

Dear All,
There is a new version of the ZeligChoice package now available for testing.  ZeligChoice is a Zelig module that contains limited-dependent variable choice models.  This release fixes issues in the ordered probit model, and improves plot graphics for ordered logit, ordered probit and multinomial probit.  If anyone has comments on these models, this package, any suggestions they would like to see, or anything related, do let me know.

You can install this version currently from:

install.packages("ZeligChoice"repos="http://r.iq.harvard.edu"type="source")


Depending on feedback, this will be posted to CRAN in about a week.

Thanks,
James

--
James Honaker, Senior Research Scientist
//// Institute for Quantitative Social Science, Harvard University
<div>
<div>Dear All,
<div>There is a new version of the ZeligChoice package now available for testing. &nbsp;ZeligChoice is a Zelig module that contains limited-dependent variable choice models. &nbsp;This release fixes issues in the ordered probit model, and improves plot graphics for ordered
 logit, ordered probit and multinomial probit. &nbsp;If anyone has comments on these models, this package, any suggestions they would like to see, or anything related, do let me know.</div>
<div><br></div>
<div>You can install this version currently from:</div>
<div><br></div>
<div>
<p>
<span>install.packages(</span>"ZeligChoice"<span>,&nbsp;</span><span>repos</span><span>=</span>"http://r.iq.harvard.edu"<span>,&nbsp;</span><span>type</span><span>=</span>"source"<span>)</span></p>
</div>
<div><br></div>
<div>Depending on feedback, this will be posted to CRAN in about a week.</div>
<div><br></div>
<div>Thanks,</div>
<div>James<br><div>
<br><div class="BodyFragment">
<div class="PlainText">--<br>
James Honaker, Senior Research Scientist<br>
//// Institute for Quantitative Social Science, Harvard University</div>
</div>
</div>
</div>
</div>
</div>
Singh, Anubhav | 26 Apr 2013 04:58
Favicon

Potential Problem with Zelig library

Hi,

I am using the Zelig package since my dataset is imputed. Somehow while using the function on linux (using R 2.15.2) with Zelig (version 4.1-3)  I am facing the error:

Error in UseMethod("multi.dataset") :

  no applicable method for 'multi.dataset' applied to an object of class "function"

  Calls: zelig -> eval -> eval -> multi.dataset

  Execution halted

But the same example works with the older version of Zelig package (3.5.5) while installing the native packages on an older machine. Due to this limitation I am not able to execute the package on Redhat. It would be great if you could advise me on an alternative or if you could provide me the Zelig tar file (version 3.5.5).

 

Thanks in advance,

Anubhav

<div>
<div class="WordSection1">
<p class="MsoNormal">Hi,<p></p></p>
<p class="MsoNormal">I am using the Zelig package since my dataset is imputed. Somehow while using the function on linux (using R 2.15.2) with Zelig (version 4.1-3) &nbsp;I am facing the error:<p></p></p>
<p class="MsoNormal">Error in UseMethod("multi.dataset") :<p></p></p>
<p class="MsoNormal">&nbsp; no applicable method for 'multi.dataset' applied to an object of class "function"<p></p></p>
<p class="MsoNormal">&nbsp; Calls: zelig -&gt; eval -&gt; eval -&gt; multi.dataset<p></p></p>
<p class="MsoNormal">&nbsp; Execution halted<p></p></p>
<p class="MsoNormal">But the same example works with the older version of Zelig package (3.5.5) while installing the native packages on an older machine. Due to this limitation I am not able to execute the package on Redhat. It would be great if you could advise
 me on an alternative or if you could provide me the Zelig tar file (version 3.5.5).<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Thanks in advance,<p></p></p>
<p class="MsoNormal">Anubhav<p></p></p>
</div>
</div>
Cesar Zucco | 25 Apr 2013 17:20
Picon

fitted.values(zeligobject) not available?

Hi there, I just now upgraded to R 3.0.0, running Zelig 4.1-3, on a Mac OS 10.8.3.

Some code I had written before is no longer working, and the reason seems to be that Zelig objects can no
longer be manipulated with fitted() or fitted.values(), as before. 

More specifically:

> my.model <- zelig(dv~iv1+iv2, data=my,data,model="ls",cite=F)
> fitted(my.model)
NULL
> fitted.values(my.model)
NULL
> predict(im.basic3)
Error in min(y) : invalid 'type' (list) of argument

Is this a bug, is this me, or was this done in purpose?

Cesar Zucco

Honaker, James | 25 Apr 2013 05:06
Picon
Favicon

Re: summary error

Dustin,
In general, the summary provided often does not resemble the expectation of a summary() and this needs to be reformatted, although the summary.gee() might be contributing in this case, as Patrick points out.  I'll move this up the priority list.

As for the second problem, there are are some intertwined and longstanding issues that have been noted on the list with treatment of missing data, and those should finally be resolved in the next couple days.

James

--
James Honaker, Senior Research Scientist
//// Institute for Quantitative Social Science, Harvard University


-----Original message-----
From: Patrick Lam <plam <at> fas.harvard.edu>
To: "Tingley, Dustin" <dtingley <at> gov.harvard.edu>
Cc: "zelig <at> lists.gking.harvard.edu" <zelig <at> lists.gking.harvard.edu>
Sent: Wed, Apr 24, 2013 23:23:50 GMT+00:00
Subject: Re: [zelig] summary error

i believe the huge matrix is the working correlation matrix, which the gee package now chooses to output in summary, so it doesn't seem strictly like a zelig issue.  although the zelig version does display an extra long call function in the output, which may need to be fixed.


On Wed, Apr 24, 2013 at 6:44 PM, dustin tingley <dtingley <at> gov.harvard.edu> wrote:
Hi-

when I run summary on this model output, I just get this giant set of matrices rather than the summary of the model.

r3<-zelig(wrongright3~mean.firstatt , model="probit.gee", robust=TRUE, id="student", corstr = "exchangeable", data=m)

Further, the sim function still appears to not support case wise deletion of missing data...it just throws an error that doesn't tell you that that is what the problem is.

Dustin

Dustin Tingley
Government Department
Harvard University
http://scholar.harvard.edu/dtingley
Director, Program on Experience Based Learning in the Social Sciences

-
--
Zelig Mailing List, served by HUIT
Send messages: zelig <at> lists.gking.harvard.edu
[un]subscribe Options: http://lists.gking.harvard.edu/mailman/listinfo/zelig
Zelig program information: http://gking.harvard.edu/zelig/
Zelig mailing list
Zelig <at> lists.gking.harvard.edu

To unsubscribe from this list or get other information:

https://lists.gking.harvard.edu/mailman/listinfo/zelig



--
Patrick Lam
Department of Government and Institute for Quantitative Social Science, Harvard University
http://www.patricklam.org
<div>
<div>Dustin,<br>
In general, the summary provided often does not resemble the expectation of a summary() and this needs to be reformatted, although the summary.gee() might be contributing in this case, as Patrick points out.&nbsp; I'll move this up the priority list.<br><br>
As for the second problem, there are are some intertwined and longstanding issues that have been noted on the list with treatment of missing data, and those should finally be resolved in the next couple days.
<br><br>
James<br><br>
--<br>
James Honaker, Senior Research Scientist<br>
//// Institute for Quantitative Social Science, Harvard University</div>
<br><br>
-----Original message-----<br><blockquote>
<div>From: Patrick Lam &lt;plam <at> fas.harvard.edu&gt;<br>
To: "Tingley, Dustin" &lt;dtingley <at> gov.harvard.edu&gt;<br>
Cc: "zelig <at> lists.gking.harvard.edu" &lt;zelig <at> lists.gking.harvard.edu&gt;<br>
Sent: Wed, Apr 24, 2013 23:23:50 GMT+00:00<br>
Subject: Re: [zelig] summary error<br><br>
</div>
<div>
<div>
<div dir="ltr">i believe the huge matrix is the working correlation matrix, which the gee package now chooses to output in summary, so it doesn't seem strictly like a zelig issue. &nbsp;although the zelig version does display an extra long call function in the output,
 which may need to be fixed.<br>
</div>
<div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Apr 24, 2013 at 6:44 PM, dustin tingley <span dir="ltr">
&lt;<a href="mailto:dtingley <at> gov.harvard.edu">dtingley <at> gov.harvard.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">
<div dir="ltr">Hi-
<div><br></div>
<div>when I run summary on this model output, I just get this giant set of matrices rather than the summary of the model.</div>
<div><br></div>
<div>
<div>r3&lt;-zelig(wrongright3~mean.firstatt , model="probit.gee", robust=TRUE, id="student", corstr = "exchangeable", data=m)</div>
<div><br></div>
<div>Further, the sim function still appears to not support case wise deletion of missing data...it just throws an error that doesn't tell you that that is what the problem is.</div>
<div><br></div>
<div>Dustin</div>
<span class="HOEnZb">
<div><br></div>
<div>Dustin Tingley<br>
Government Department<br>
Harvard University<br><a href="http://scholar.harvard.edu/dtingley" target="_BLANK">http://scholar.harvard.edu/dtingley</a>
<div>Director, Program on Experience Based Learning in the Social Sciences<br><div>
<a href="http://projects.iq.harvard.edu/peblss/" target="_BLANK">http://projects.iq.harvard.edu/peblss/</a>
</div>
<div>Contribute to the Research Reservoir:&nbsp;<a href="http://projects.iq.harvard.edu/undergradscholars/pages/research-resources" target="_BLANK">http://projects.iq.harvard.edu/undergradscholars/pages/research-resources</a>
</div>
</div>
</div>
</span>
</div>
</div>
<br>
-<br>
--<br>
Zelig Mailing List, served by HUIT<br>
Send messages: <a href="mailto:zelig <at> lists.gking.harvard.edu">zelig <at> lists.gking.harvard.edu</a><br>
[un]subscribe Options: <a href="http://lists.gking.harvard.edu/mailman/listinfo/zelig" target="_BLANK">
http://lists.gking.harvard.edu/mailman/listinfo/zelig</a><br>
Zelig program information: <a href="http://gking.harvard.edu/zelig/" target="_BLANK">
http://gking.harvard.edu/zelig/</a><br>
Zelig mailing list<br><a href="mailto:Zelig <at> lists.gking.harvard.edu">Zelig <at> lists.gking.harvard.edu</a><br><br>
To unsubscribe from this list or get other information:<br><br><a href="https://lists.gking.harvard.edu/mailman/listinfo/zelig" target="_BLANK">https://lists.gking.harvard.edu/mailman/listinfo/zelig</a><br>
</blockquote>
</div>
<br><br clear="all"><div><br></div>
-- <br><div dir="ltr">Patrick Lam<br>
Department of Government and Institute for Quantitative Social Science, Harvard University<br><a href="http://www.patricklam.org" target="_BLANK">http://www.patricklam.org</a>
</div>
</div>
</div>
</div>
</blockquote>
</div>
dustin tingley | 25 Apr 2013 00:44
Picon
Favicon

summary error

Hi-

when I run summary on this model output, I just get this giant set of matrices rather than the summary of the model.

r3<-zelig(wrongright3~mean.firstatt , model="probit.gee", robust=TRUE, id="student", corstr = "exchangeable", data=m)

Further, the sim function still appears to not support case wise deletion of missing data...it just throws an error that doesn't tell you that that is what the problem is.

Dustin

Dustin Tingley
Government Department
Harvard University
http://scholar.harvard.edu/dtingley
Director, Program on Experience Based Learning in the Social Sciences
<div><div dir="ltr">Hi-<div><br></div>
<div>when I run summary on this model output, I just get this giant set of matrices rather than the summary of the model.</div>
<div><br></div>
<div>
<div>r3&lt;-zelig(wrongright3~mean.firstatt , model="probit.gee", robust=TRUE, id="student", corstr = "exchangeable", data=m)</div>

<div><br></div>
<div>Further, the sim function still appears to not support case wise deletion of missing data...it just throws an error that doesn't tell you that that is what the problem is.</div>
<div><br></div>
<div>Dustin</div>
<div><br></div>
<div>Dustin Tingley<br>Government Department<br>Harvard University<br><a href="http://scholar.harvard.edu/dtingley" target="_blank">http://scholar.harvard.edu/dtingley</a><div>

Director, Program on Experience Based Learning in the Social Sciences<br><div>
<a href="http://projects.iq.harvard.edu/peblss/" target="_blank">http://projects.iq.harvard.edu/peblss/</a>
</div>
<div>Contribute to the Research Reservoir:&nbsp;<a href="http://projects.iq.harvard.edu/undergradscholars/pages/research-resources" target="_blank">http://projects.iq.harvard.edu/undergradscholars/pages/research-resources</a>
</div>

</div>
</div>
</div>
</div></div>

Gmane