Alvelo, Jaime | 5 Dec 15:14 2014

Greetings From Puerto Rico- A consult on Mulpile Imputation Programming

Hello:

I’ve been refer to this list  by Dr. Merce Crosas by way of Dr. Gary King. I’ve been involved in a “freebie” project of as an offshoot of a project that was funded by the Alzheimer Association to create a scale to measure “caregiver burden”. My former social work chief and a colleague involved in giving support group therapy to caregivers of veterans with Alzheimer  approached me to adapt  and validate to Spanish the Marwit Meuser Caregiver Grief Inventory (Short Form) back in 2008. I had experience in doing so with a 312 item battery for screening psychosocial problems  called the MPSI by Walter Hudson so I agreed (late 1990’s early 2000’s).

The project went real slow as our sample came in gradually through volunteers in the VA caregiver support groups and we also experienced a one year research suspension at our hospital. Finally in 2013 we had finished collecting the data and proceeded to analyze it. I’m not fully in academia but have been a PT lecturer at a local university school of social work and my research has been sporadic so I wasn’t up to date in the issues of dealing with missing data until an expert psychometrician who has published a bit on the topic questioned my approach to handling of the missing data. I had done the traditional scale average to substitute missing data points. He said multiple imputation was the approach to be used.  So I read a bit and agreed. That was in June 2014. This meant re-doing all my prior analysis and the bad news is that we did not have the software at the VA.

I found out the software was free but there was a rigorous protocol in the VA for installing new software: it must be reviewed by an expert group  at the national level. So the process started with R; followed by Amelia II; followed by Zelig and then Lavaan (did also test one called FACTOR). The process of review and approval has taken 5 months so now we are ready to roll.

As this is a “freebie” for the social work profession we don’t have a programmer and I’ve had to read the manuals and do the work myself (I did know well SPSS Mainframe and SPSSPC but the version we had did not do multiple imputing and the purchase price of their programs were not in our 0 budget). So I’ve learn to run a bit of R; managed to run Amelia II and create my 5 multiple data frames of our scale.

The scale has 18 items with responses in a 5 point Likert scale format ( 1 through 5). We have the Spanish version responses  of 100 subjects of an approved R&D project. Short term goal is to get the 5 data frames integrated into one data frame using Zelig. After that we will run lavaan to see if the dimensions of the Spanish version are the same as the English version of the instrument….

I’ve downloaded the Zelig Manual but couldn’t find the specifics on how the program integrates 5 data sets into one under R. I’ve written to the author of the Manual and Dr. Merce and it seems that they are hopeful that a technical programmer may have a simple solution to this issue. Please be aware that we cannot export the data outside of the VA and the work must be done at my PC so maybe some examples of programming statements may suffice.

Any help will be appreciated. I can promise you a free lunch and a tour of Piñones beach area if you come down to PR when things get too cold up there.

 

 

Jaime Alvelo, DSW
VA Caribbean Healthcare System
R&D Service (151)

10 Casia Street
San Juan, PR 00921-3201
787-641-7582 Ext 10175 

Main Building-Basement-Office A55
Jaime.Alvelo-epfaOiJH9AY@public.gmane.org

 

 

 

PD: I’m at the VA Mondays, Wednesdays and Fridays

e-mail at home is : aibonito-Ts12bCdYo6esTnJN9+BGXg@public.gmane.org

Cellular phone on Tuesdays and Thursdays: 787-306-4934

 

 

 

 

 

<div><div class="WordSection1">
<p class="MsoNormal">Hello:<p></p></p>
<p class="MsoNormal">I&rsquo;ve been refer to this list&nbsp; by Dr. Merce Crosas by way of Dr. Gary King. I&rsquo;ve been involved in a &ldquo;freebie&rdquo; project of as an offshoot of a project that was funded by the Alzheimer Association to create a scale to measure &ldquo;caregiver burden&rdquo;. My former social work chief and a colleague involved in giving support group therapy to caregivers of veterans with Alzheimer &nbsp;approached me to adapt &nbsp;and validate to Spanish the Marwit Meuser Caregiver Grief Inventory (Short Form) back in 2008. I had experience in doing so with a 312 item battery for screening psychosocial problems &nbsp;called the MPSI by Walter Hudson so I agreed (late 1990&rsquo;s early 2000&rsquo;s).<p></p></p>
<p class="MsoNormal">The project went real slow as our sample came in gradually through volunteers in the VA caregiver support groups and we also experienced a one year research suspension at our hospital. Finally in 2013 we had finished collecting the data and proceeded to analyze it. I&rsquo;m not fully in academia but have been a PT lecturer at a local university school of social work and my research has been sporadic so I wasn&rsquo;t up to date in the issues of dealing with missing data until an expert psychometrician who has published a bit on the topic questioned my approach to handling of the missing data. I had done the traditional scale average to substitute missing data points. He said multiple imputation was the approach to be used. &nbsp;So I read a bit and agreed. That was in June 2014. This meant re-doing all my prior analysis and the bad news is that we did not have the software at the VA.<p></p></p>
<p class="MsoNormal">I found out the software was free but there was a rigorous protocol in the VA for installing new software: it must be reviewed by an expert group&nbsp; at the national level. So the process started with R; followed by Amelia II; followed by Zelig and then Lavaan (did also test one called FACTOR). The process of review and approval has taken 5 months so now we are ready to roll.<p></p></p>
<p class="MsoNormal">As this is a &ldquo;freebie&rdquo; for the social work profession we don&rsquo;t have a programmer and I&rsquo;ve had to read the manuals and do the work myself (I did know well SPSS Mainframe and SPSSPC but the version we had did not do multiple imputing and the purchase price of their programs were not in our 0 budget). So I&rsquo;ve learn to run a bit of R; managed to run Amelia II and create my 5 multiple data frames of our scale.<p></p></p>
<p class="MsoNormal">The scale has 18 items with responses in a 5 point Likert scale format ( 1 through 5). We have the Spanish version responses&nbsp; of 100 subjects of an approved R&amp;D project. Short term goal is to get the 5 data frames integrated into one data frame using Zelig. After that we will run lavaan to see if the dimensions of the Spanish version are the same as the English version of the instrument&hellip;.<p></p></p>
<p class="MsoNormal">I&rsquo;ve downloaded the Zelig Manual but couldn&rsquo;t find the specifics on how the program integrates 5 data sets into one under R. I&rsquo;ve written to the author of the Manual and Dr. Merce and it seems that they are hopeful that a technical programmer may have a simple solution to this issue. Please be aware that we cannot export the data outside of the VA and the work must be done at my PC so maybe some examples of programming statements may suffice.<p></p></p>
<p class="MsoNormal">Any help will be appreciated. I can promise you a free lunch and a tour of Pi&ntilde;ones beach area if you come down to PR when things get too cold up there.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><span>Jaime Alvelo, DSW</span><span> <br></span><span>VA Caribbean Healthcare System</span><span> <br></span><span>R&amp;D Service (151)<p></p></span></p>
<p class="MsoNormal"><span>10 Casia Street</span><span> <br></span><span>San Juan, PR 00921-3201 </span><span><br></span><span>787-641-7582 Ext 10175&nbsp; <p></p></span></p>
<p class="MsoNormal"><span>Main Building-Basement-Office A55</span><span><br></span><span><a href="mailto:Jaime.Alvelo@..."><span>Jaime.Alvelo@...</span></a></span><span> <p></p></span></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">PD: I&rsquo;m at the VA Mondays, Wednesdays and Fridays<p></p></p>
<p class="MsoNormal"><span>e-mail at home is : <a href="mailto:aibonito@..." target="_blank">aibonito@...</a></span><p></p></p>
<p class="MsoNormal"><span>Cellular phone on Tuesdays and Thursdays: <a href="tel:787-306-4934" target="_blank">787-306-4934</a></span><p></p></p>
<p class="MsoNormal">&nbsp;<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
</div></div>
David Kane | 4 Nov 13:43 2014
Picon

Zelig ought to import specific functions rather than Depend on 12 packages

The current version of the DESCRIPTION file for Zelig has 12 packages listed under Depends. Writing R Extensions explains why this is a bad idea.

http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Package-Dependencies

Key passage:

"Field ‘Depends’ should nowadays be used rarely, only for packages which are intended to be put on the search path to make their facilities available to the end user (and not to the package itself): for example it makes sense that a user of package latticeExtra would want the functions of package lattice made available.

Almost always packages mentioned in ‘Depends’ should also be imported from in the NAMESPACE file: this ensures that any needed parts of those packages are available when some other package imports the current package."

This is especially true for Zelig because of naming conflicts between some of the packages in Depends. For me (and others?) the key issue involves dplyr and MASS. Both have a function called "select." That function is critically important to any user of dplyr. (I don't think it matters much to users of MASS.) But because MASS is listed before dplyr in Depends in Zelig, there is no way (if you have Zelig loaded) to have "select" refer to the function in dplyr.

Also, including both plyr and dplyr in Depends seems very sloppy.

The solution (and current best practice in R) is to not use Depends so much, if at all, and to only import functions from a package like MASS that you actually need.

Thanks.




<div><div dir="ltr">The current version of the DESCRIPTION file for Zelig has 12 packages listed under Depends. Writing R Extensions explains why this is a bad idea. <br><br><a href="http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Package-Dependencies">http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Package-Dependencies</a><br><br>Key passage:<br><br>"Field &lsquo;Depends&rsquo; should nowadays be used rarely, only for packages
which are intended to be put on the search path to make their facilities
available to the end user (and not to the package itself): for example
it makes sense that a user of package <a href="http://CRAN.R-project.org/package=latticeExtra">latticeExtra</a> would want
the functions of package <a href="http://CRAN.R-project.org/package=lattice">lattice</a> made available.

<p>Almost always packages mentioned in &lsquo;Depends&rsquo; should also be
imported from in the NAMESPACE file: this ensures that any needed
parts of those packages are available when some other package imports
the current package."</p>
<p>This is especially true for Zelig because of naming conflicts between some of the packages in Depends. For me (and others?) the key issue involves dplyr and MASS. Both have a function called "select." That function is critically important to any user of dplyr. (I don't think it matters much to users of MASS.) But because MASS is listed before dplyr in Depends in Zelig, there is no way (if you have Zelig loaded) to have "select" refer to the function in dplyr.</p>
<p>Also, including both plyr and dplyr in Depends seems very sloppy. <br></p>
<p>The solution (and current best practice in R) is to not use Depends so much, if at all, and to only import functions from a package like MASS that you actually need.</p>
<p>Thanks.<br></p>
<p><br></p>
<br><br>
</div></div>
David Kane | 21 Oct 14:50 2014
Picon

Bug in Zelig scoping?

I *believe* that there is a bug in Zelig's scoping. This exists on the cran version (from where it bit me) but also in the development version.

> packageVersion("Zelig")
[1] "5.0.2"
>

Interactively, the Zelig demo works fine:

> data(cars)
> x <- cars
> zelig(dist ~ speed, data = x, model = "ls")
How to cite this model in Zelig:
  Kosuke Imai, Gary King, and Olivia Lau. 2007.
...
>

Note that assigning cars to x and then passing x as the argument to data is needed to demonstrate the bug. The problem comes when we wrap this code within a function.

> rm(list = ls())
> test_function <- function(){data(cars); x <- cars; zelig(dist ~ speed, data = x, model = "ls")}
> test_function()
Error in callSuper(formula = formula, data = data, ..., weights = NULL,  :
  object 'x' not found
How to cite this model in Zelig:
  Kosuke Imai, Gary King, and Olivia Lau. 2007.
...
>

It is the Error above that is the problem. (Strangely, the code still seems to work in the development version after issuing that Error message. In the CRAN version, it does not.)

Note that you need to keep your workplace clean to see this clearly. See the rm(list = ls()) above. If you don't issue this command (after doing the interactive code), you don't get any error:

> rm(list = ls())
> data(cars)
> x <- cars
> zelig(dist ~ speed, data = x, model = "ls")
How to cite this model in Zelig:
  Kosuke Imai, Gary King, and Olivia Lau. 2007.
...
> test_function <- function(){data(cars); x <- cars; zelig(dist ~ speed, data = x, model = "ls")}
> test_function()
How to cite this model in Zelig:
  Kosuke Imai, Gary King, and Olivia Lau. 2007.
...
>

No Error because Zelig finds x in the global environment. Of course, it should be using the local x.

My colleague thinks that, in the CRAN version, this snippet of code is wrong:

divided.data <- eval(call("multi.dataset", substitute(data)))


But I am not enough of an R guru to determine the cause of the bug.

Thanks,

Dave Kane

<div><div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>I *believe* that there is a bug in Zelig's scoping. This exists on the cran version (from where it bit me) but also in the development version. <br><br>&gt; packageVersion("Zelig")<br>[1] "5.0.2"<br>&gt; <br><br>
</div>Interactively, the Zelig demo works fine:<br><br>&gt; data(cars)<br>&gt; x &lt;- cars<br>&gt; zelig(dist ~ speed, data = x, model = "ls")<br>How to cite this model in Zelig:<br>&nbsp; Kosuke Imai, Gary King, and Olivia Lau. 2007.<br>...<br>&gt; <br><br>
</div>Note that assigning cars to x and then passing x as the argument to data is needed to demonstrate the bug. The problem comes when we wrap this code within a function.<br><br>&gt; rm(list = ls())<br>&gt; test_function &lt;- function(){data(cars); x &lt;- cars; zelig(dist ~ speed, data = x, model = "ls")}<br>&gt; test_function()<br>Error in callSuper(formula = formula, data = data, ..., weights = NULL,&nbsp; : <br>&nbsp; object 'x' not found<br>How to cite this model in Zelig:<br>&nbsp; Kosuke Imai, Gary King, and Olivia Lau. 2007.<br>...<br>&gt;<br><br>
</div>It is the Error above that is the problem. (Strangely, the code still seems to work in the development version after issuing that Error message. In the CRAN version, it does not.)<br><br>
</div>Note that you need to keep your workplace clean to see this clearly. See the rm(list = ls()) above. If you don't issue this command (after doing the interactive code), you don't get any error:<br><br>&gt; rm(list = ls())<br>&gt; data(cars)<br>&gt; x &lt;- cars<br>&gt; zelig(dist ~ speed, data = x, model = "ls")<br>How to cite this model in Zelig:<br>&nbsp; Kosuke Imai, Gary King, and Olivia Lau. 2007.<br>...<br>&gt; test_function &lt;- function(){data(cars); x &lt;- cars; zelig(dist ~ speed, data = x, model = "ls")}<br>&gt; test_function()<br>How to cite this model in Zelig:<br>&nbsp; Kosuke Imai, Gary King, and Olivia Lau. 2007.<br>...<br>&gt; <br><br>
</div>No Error because Zelig finds x in the global environment. Of course, it should be using the local x.<br><br>
</div>My colleague thinks that, in the CRAN version, this snippet of code is wrong:<br><br><p class="MsoNormal"><span>divided.data &lt;-
eval(call("multi.dataset", substitute(data)))</span></p>

<br>
</div>
<div>But I am not enough of an R guru to determine the cause of the bug.<br><br>
</div>
<div>Thanks,<br><br>Dave Kane<br>
</div>
<br>
</div></div>
Michael Tsikerdekis | 19 Oct 21:41 2014
Picon

Bayesian regression and importance of predictors

Hi everyone,

I am running a logit.bayes model and I get the results that closely resemble regular logistic regression. I need to determine the importance of predictors.

I want to try and determine which coefficients are more "powerful." I have ordered variables, numeric as well as binary as predictors. I attempted to standardize these using the rescale function from arm package but still the process fails for ordered variables (coefficients do not seem to be standardized). In general standardizing variables to obtain beta coefficients may not be the most efficient way to determine the importance of variables.

Another way to do this is to use an model information value or similar value. For example, DIC (or R^2 in traditional regression). I know that rjags does report DIC but I would have to build the models manually there.

Is there a way to include DIC for zelig bayesian models?

If anyone has an alternative way to determine the importance of predictors when predictors are on different scales, I would love to hear about it.

Thanks,
Michael
<div><div dir="ltr">
<div>Hi everyone,</div>
<div><br></div>
<div>I am running a logit.bayes model and I get the results that closely resemble regular logistic regression. I need to determine the importance of predictors.<br>
</div>
<div><br></div>
<div>I want to try and determine which coefficients are more "powerful." I have ordered variables, numeric as well as binary as predictors. I attempted to standardize these using the rescale function from arm package but still the process fails for ordered variables (coefficients do not seem to be standardized). In general standardizing variables to obtain beta coefficients may not be the most efficient way to determine the importance of variables.</div>
<div><br></div>
<div>Another way to do this is to use an model information value or similar value. For example, DIC (or R^2 in traditional regression). I know that rjags does report DIC but I would have to build the models manually there.</div>
<div><br></div>
<div>Is there a way to include DIC for zelig bayesian models?</div>
<div><br></div>
<div>If anyone has an alternative way to determine the importance of predictors when predictors are on different scales, I would love to hear about it.</div>
<div><br></div>
<div>Thanks,</div>
<div>Michael</div>
</div></div>
Jennifer Boylan | 11 Oct 02:00 2014
Picon

adding a covariate to ei.RxC models

Hi Zelig Helplist,

I've am looking to add a covariate to several ei.RxC models I have run. But I've run into several problems. I think I may be issuing a command incorrectly...

When I added a covariate to my model, my output changed slightly. But then I realized that no matter the covariate I was using, the output was the same each time (i.e. the output was the same regardless of the covariate used...)! In another model, when I added a covariate, the output didn't change at all. And I was remembering to set the covariate to its mean. 

The identity columns I am using are numbers of individuals, as opposed to percents. So I was thinking that the problem was I was using a covariate that was a decimaled percent. I replaced with the whole number equivalent and the same result occurred. 

I'm attaching a picture of the end of my dataset to this email. You'll see that the ethnic categories I'm using, such as Mo and Sisala, are reported in whole population numbers. The covariate I am attempting to use is percentage of urban residents in a particular district. 'urban' is listed as a decimaled proportion, but I also tried 'urban2' which is a whole population number (i.e. the district pop total * urban).  


Below is some sample code:

STATA <- read.dta(file.choose())
#using 2012registrationtoEstimates 
View(STATA)

set.seed(7)

z.out <- zelig(cbind(registeredvoters, nonregistered) ~ agona + ahafo + ahanta + akuapem + akwamu + akyem + aowin + asante + asen + boron + chokosi + denkyira + evalue + fante + kwahu + nzema + sefwi + wasa + bawle + otherakan + dangme + ga + otherga + ewe + guan1 + guan2 + guan3 + guan4 + guan5 + guan6 + guan7 + guan8 + otherguan + bimoba + kokomba + basare + pilapila + salfalba + kotokoli + chamba + othergurma + builsa + dagarte + wali + dagomba + kusasi + mamprusi + namnam + nankansi + nanumba + mosi + othermole + kasena + mo + sisala + vagala + othergrusi1 + othergrusi2 + busanga + wangara + othermande + otherinside + otheroutside, COVAR = ~urban2, model = "ei.RxC", data = STATA)

x.out <- setx(z.out)

s.out <- sim(z.out, num = 100)

var7 <- summary(s.out)

dataframe=as.data.frame(var7$qi.stats)

write.dta(dataframe, "2012regisURBANnew.dta")

regis2012URB <- read.table(file.choose(), header=TRUE)
View(regis2012URB)

stargazer(regis2012URB[ , ], style="apsr", rownames=FALSE, summary=FALSE)


Thanks very much,

Jennifer

--
PhD Candidate
Department of Political Science
University of Florida
PO Box 117325
Gainesville, FL 32611-7325
<div><div dir="ltr">Hi Zelig Helplist,<div><br></div>
<div>I've am looking to add a covariate to several ei.RxC models I have run. But I've run into several problems. I think I may be issuing a command incorrectly...</div>
<div><br></div>
<div>When I added a covariate to my model, my output changed slightly. But then I realized that no matter the covariate I was using, the output was the same each time (i.e. the output was the same regardless of the covariate used...)! In another model, when I added a covariate, the output didn't change at all. And I was remembering to set the covariate to its mean.&nbsp;</div>
<div><br></div>
<div>The identity columns I am using are numbers of individuals, as opposed to percents. So I was thinking that the problem was I was using a covariate that was a decimaled percent. I replaced with the whole number equivalent and the same result occurred.&nbsp;</div>
<div><br></div>
<div>I'm attaching a picture of the end of my dataset to this email. You'll see that the ethnic categories I'm using, such as Mo and Sisala, are reported in whole population numbers. The covariate I am attempting to use is percentage of urban residents in a particular district. 'urban' is listed as a decimaled proportion, but I also tried 'urban2' which is a whole population number (i.e. the district pop total * urban). &nbsp;</div>
<div><br></div>
<div><br></div>
<div>Below is some sample code:</div>
<div><br></div>
<div>
<div>STATA &lt;- read.dta(file.choose())</div>
<div>#using 2012registrationtoEstimates&nbsp;</div>
<div>View(STATA)</div>
<div><br></div>
<div>set.seed(7)</div>
<div><br></div>
<div>z.out &lt;- zelig(cbind(registeredvoters, nonregistered) ~ agona + ahafo + ahanta + akuapem + akwamu + akyem + aowin + asante + asen + boron + chokosi + denkyira + evalue + fante + kwahu + nzema + sefwi + wasa + bawle + otherakan + dangme + ga + otherga + ewe + guan1 + guan2 + guan3 + guan4 + guan5 + guan6 + guan7 + guan8 + otherguan + bimoba + kokomba + basare + pilapila + salfalba + kotokoli + chamba + othergurma + builsa + dagarte + wali + dagomba + kusasi + mamprusi + namnam + nankansi + nanumba + mosi + othermole + kasena + mo + sisala + vagala + othergrusi1 + othergrusi2 + busanga + wangara + othermande + otherinside + otheroutside, COVAR = ~urban2, model = "ei.RxC", data = STATA)</div>
<div><br></div>
<div>x.out &lt;- setx(z.out)</div>
<div><br></div>
<div>s.out &lt;- sim(z.out, num = 100)</div>
<div><br></div>
<div>var7 &lt;- summary(s.out)</div>
<div><br></div>
<div>dataframe=as.data.frame(var7$qi.stats)</div>
<div><br></div>
<div>write.dta(dataframe, "2012regisURBANnew.dta")</div>
<div><br></div>
<div>regis2012URB &lt;- read.table(file.choose(), header=TRUE)</div>
<div>View(regis2012URB)</div>
<div><br></div>
<div>stargazer(regis2012URB[ , ], style="apsr", rownames=FALSE, summary=FALSE)</div>
<div><br></div>
<div><br></div>
<div>Thanks very much,</div>
<div><br></div>
<div>Jennifer</div>
<div><br></div>-- <br>PhD Candidate<br>Department of Political Science<br>University of Florida<br>PO Box 117325<br>Gainesville, FL 32611-7325
</div>
</div></div>
Karsten Biermeier | 25 Aug 13:35 2014
Picon

ZeligMultilevel warning " | "

Dear list members,
 
I try to run a multilevel model with ZeligMultilevel and use setx() and sim() afterwards.
zelig() works, but setx() leads to the following warning:
 
> x.high <- setx(z.reg1, studage=8) Warning message: In Ops.factor(1, dept) : | not meaningful for factors
 
From my point of view, it seems to be strange because "|" is a usual expression for lme4 based multilevel models.
How to deal with it? Can I just ignore it?
 
Thanks,
Tim
 
( R version 3.1.1; all packages are up to date. )
Below you find an example to replicate the situation.
library("ZeligMultilevel")
data(InstEval)
z.reg1 <- zelig(y ~ studage + service + tag(1 | dept), data=InstEval, model="ls.mixed")
summary(z.reg1)
x.high <- setx(z.reg1, studage=8)
x.low <- setx(z.reg1, studage=2)
s.reg1 <- sim(z.reg1, x=x.high, x1=x.low)
summary(s.reg1)
( example from http://www.polsci.ucsb.edu/faculty/glasgow/ps207/ps207_class8.r )
 
<div><div>
<div>Dear list members,</div>

<div>&nbsp;</div>

<div>I try to run a multilevel model with ZeligMultilevel and use setx() and sim() afterwards.</div>

<div>zelig() works, but setx() leads to the following warning:</div>

<div>&nbsp;</div>

<div>
<span><span class="GEWYW5YBJEB ace_keyword">&gt; </span><span class="GEWYW5YBMDB ace_keyword">x.high &lt;- setx(z.reg1, studage=8)
</span><span class="GEWYW5YBAEB  ace_constant">Warning message:
</span><span class="GEWYW5YBAEB  ace_constant">In Ops.factor(1, dept) : | not meaningful for factors</span></span>

<div>&nbsp;</div>
</div>

<div>From my point of view, it seems to be strange because "|" is a usual expression for lme4 based multilevel models.</div>

<div>How to deal with it? Can I just ignore it?</div>

<div>&nbsp;</div>

<div>Thanks,</div>

<div>Tim</div>

<div>&nbsp;</div>

<div>(<span> R version 3.1.1</span>; all packages are up to date. )</div>

<div>Below you find an example to replicate the situation.</div>

<div>
<div>library("ZeligMultilevel")</div>

<div>
<div>data(InstEval)</div>

<div>
<div>z.reg1 &lt;- zelig(y ~ studage + service + tag(1 | dept), data=InstEval, model="ls.mixed")</div>

<div>summary(z.reg1)</div>

<div>x.high &lt;- setx(z.reg1, studage=8)<br>
x.low &lt;- setx(z.reg1, studage=2)</div>

<div>s.reg1 &lt;- sim(z.reg1, x=x.high, x1=x.low)<br>
summary(s.reg1)</div>

<div>( example from http://www.polsci.ucsb.edu/faculty/glasgow/ps207/ps207_class8.r )<br>
&nbsp;</div>
</div>
</div>
</div>
</div></div>
Daniel Eirikson | 15 Aug 19:56 2014
Picon

Measures of goodness-of-fit using multiply imputed data in Zelig

Dear list members,

I am running a logistic regression model in R using multiply imputed data created using Amelia II, which I am then analyzing using Zelig. I would like to be able to report some measures of goodness-of-fit (e.g. likelihood ratio, pseudo R-squared, Hosmer-Lemeshow) and was wondering what options I have when using Zelig to analyze my data, as there are none that are provided in the default output. I know some packages that provide measures of goodness-of-fit, such as pscl, only work on glm objects, not MI objects created when using Amelia and Zelig.

Are there any measures of goodness-of-fit that can be extracted from the zelig() object, and if so how? And if not, does anyone know if there are there any other packages that can run these tests on multiply imputed datasets?

Thanks in advance for your help!

Best,
Daniel
<div><div dir="ltr">Dear list members,<br><br>I am running a logistic regression model in R using multiply imputed data created using Amelia II, which I am then analyzing using Zelig. I would like to be able to report some measures of goodness-of-fit (e.g. likelihood ratio, pseudo R-squared, Hosmer-Lemeshow) and was wondering what options I have when using Zelig to analyze my data, as there are none that are provided in the default output. I know some packages that provide measures of goodness-of-fit, such as pscl, only work on glm objects, not MI objects created when using Amelia and Zelig.<br><br>Are there any measures of goodness-of-fit that can be extracted from the zelig() object, and if so how? And if not, does anyone know if there are there any other packages that can run these tests on multiply imputed datasets?<br><br>Thanks in advance for your help!<br><br>Best,<br>Daniel</div></div>
Jennifer Boylan | 12 Aug 01:54 2014
Picon

loading Zelig...

Hi Zelig,

 

I’m having trouble loading the Zelig package to my machine. My goal is to use the ei.RxC model, but I can’t get access Zelig to begin with.

 

I installed the Zelig 4.2-1 version, but when I call library(Zelig), I get an error:

 

Error : .onAttach failed in attachNamespace() for 'Zelig', details:

  call: NULL

  error: '.readRDS' is defunct.

Use 'readRDS' instead.

See help("Defunct")

Error: package or namespace load failed for ‘Zelig’

 

I also rolled back Zelig to version 3.5 on the hopes that it would work, but no change.

 

I have been following the installation guide (http://zeligdev.github.io/files/zelig.pdf), among many other resources, and I am using R version 3.0.2.


I have also noticed others have had this problem in the past (http://comments.gmane.org/gmane.comp.lang.r.zelig/783) but downloading from the CRAN Network as opposed to manually with an install.packages() command made no difference in my case.

 


Please any advice on what I am doing wrong here?

 

Thanks,

 

Jennifer Boylan


For reference purposes, these are the packages I have loaded in my libraries:
Packages in library ‘C:/Users/Jenny/Documents/R/win-library/3.0’:

car                     Companion to Applied Regression
coda                    Output analysis and diagnostics for MCMC
colorspace              Color Space Manipulation
Defaults                Create Global Function Defaults
effects                 Effect Displays for Linear, Generalized Linear,
                        Multinomial-Logit, Proportional-Odds Logit
                        Models and Mixed-Effects Models
eiPack                  eiPack: Ecological Inference and
                        Higher-Dimension Data Management
expm                    Matrix exponential
gdata                   Various R programming tools for data
                        manipulation
gee                     Generalized Estimation Equation solver
gmodels                 Various R programming tools for model fitting
gtools                  Various R programming tools
lattice                 Lattice Graphics
lme4                    Linear mixed-effects models using Eigen and S4
lmtest                  Testing Linear Regression Models
manipulate              Interactive Plots for RStudio
markdown                Markdown rendering for R
Matrix                  Sparse and Dense Matrix Classes and Methods
matrixcalc              Collection of functions for matrix calculations
MCMCpack                Markov chain Monte Carlo (MCMC) Package
mgcv                    Mixed GAM Computation Vehicle with GCV/AIC/REML
                        smoothness estimation
mime                    Map filenames to MIME types
minqa                   Derivative-free optimization algorithms by
                        quadratic approximation
msm                     Multi-state Markov and hidden Markov models in
                        continuous time
mvtnorm                 Multivariate Normal and t Distributions
nlme                    Linear and Nonlinear Mixed Effects Models
nnet                    Feed-forward Neural Networks and Multinomial
                        Log-Linear Models
quantmod                Quantitative Financial Modelling Framework
Rcpp                    Seamless R and C++ Integration
RcppEigen               Rcpp integration for the Eigen templated linear
                        algebra library.
RMark                   R Code for MARK Analysis
rstudio                 Tools and Utilities for RStudio
sandwich                Robust Covariance Matrix Estimators
sem                     Structural Equation Models
sfsmisc                 Utilities from Seminar fuer Statistik ETH
                        Zurich
snow                    Simple Network of Workstations
snowfall                Easier cluster computing (based on snow).
systemfit               Estimating Systems of Simultaneous Equations
TTR                     Technical Trading Rules
VGAM                    Vector Generalized Linear and Additive Models
xts                     eXtensible Time Series
Zelig                   Everyone's Statistical Software
ZeligMisc               A Zelig Model
ZeligMultilevel         Multilevel Regressions for Zelig
zoo                     S3 Infrastructure for Regular and Irregular
                        Time Series (Z's ordered observations)

Packages in library ‘C:/Program Files/R/R-3.0.2/library’:

base                    The R Base Package
boot                    Bootstrap Functions (originally by Angelo Canty
                        for S)
class                   Functions for Classification
cluster                 Cluster Analysis Extended Rousseeuw et al.
codetools               Code Analysis Tools for R
compiler                The R Compiler Package
datasets                The R Datasets Package
foreign                 Read Data Stored by Minitab, S, SAS, SPSS,
                        Stata, Systat, dBase, ...
graphics                The R Graphics Package
grDevices               The R Graphics Devices and Support for Colours
                        and Fonts
grid                    The Grid Graphics Package
KernSmooth              Functions for kernel smoothing for Wand & Jones
                        (1995)
lattice                 Lattice Graphics
MASS                    Support Functions and Datasets for Venables and
                        Ripley's MASS
Matrix                  Sparse and Dense Matrix Classes and Methods
methods                 Formal Methods and Classes
mgcv                    Mixed GAM Computation Vehicle with GCV/AIC/REML
                        smoothness estimation
nlme                    Linear and Nonlinear Mixed Effects Models
nnet                    Feed-forward Neural Networks and Multinomial
                        Log-Linear Models
parallel                Support for Parallel computation in R
rpart                   Recursive Partitioning
spatial                 Functions for Kriging and Point Pattern
                        Analysis
splines                 Regression Spline Functions and Classes
stats                   The R Stats Package
stats4                  Statistical Functions using S4 Classes
survival                Survival Analysis
tcltk                   Tcl/Tk Interface
tools                   Tools for Package Development
translations            The R Translations Package
utils                   The R Utils Package


Finally, some sample script:

 > install.packages(
 "Zelig",
 type = "source", lib="C:/Users/Jenny/Documents/R/win-library/3.0"
 )
Content type 'application/x-gzip' length 3269527 bytes (3.1 Mb)
opened URL
downloaded 3.1 Mb

* installing *source* package 'Zelig' ...
** R
** data
** demo
** inst
** preparing package for lazy loading
Warning: package 'sandwich' was built under R version 3.0.3
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Warning: package 'sandwich' was built under R version 3.0.3
* DONE (Zelig)

The downloaded source packages are in
        ‘C:\Users\Jenny\AppData\Local\Temp\Rtmp8opSG8\downloaded_packages’
> library(Zelig)
## 
##  Zelig (Version 4.2-2, built: 2013-10-22)
##  Please refer to http://gking.harvard.edu/zelig for full
##  documentation or help.zelig() for help with commands and
##  models supported by Zelig.
##

##  Zelig project citations:
##    Kosuke Imai, Gary King, and Olivia Lau. (2009).
##    ``Zelig: Everyone's Statistical Software,''
##  and
##    Kosuke Imai, Gary King, and Olivia Lau. (2008).
##    ``Toward A Common Framework for Statistical Analysis
##    and Development,'' Journal of Computational and
##    Graphical Statistics, Vol. 17, No. 4 (December)
##    pp. 892-913. 

##  To cite individual Zelig models, please use the citation format printed with
##  each model run and in the documentation.
##
Error : .onAttach failed in attachNamespace() for 'Zelig', details:
  call: NULL
  error: '.readRDS' is defunct.
Use 'readRDS' instead.
See help("Defunct")
Error: package or namespace load failed for ‘Zelig’
> library()
> help.zelig(ei.RxC)
Error: could not find function "help.zelig"
> ?help.zelig()
Error in .helpForCall(topicExpr, parent.frame()) : 
  no methods for ‘help.zelig’ and no documentation for it as a function
> ??help.zelig()
> demo(package="Zelig")
> library(Zelig)
## 
##  Zelig (Version 4.2-2, built: 2013-10-22)
##  Please refer to http://gking.harvard.edu/zelig for full
##  documentation or help.zelig() for help with commands and
##  models supported by Zelig.
##

##  Zelig project citations:
##    Kosuke Imai, Gary King, and Olivia Lau. (2009).
##    ``Zelig: Everyone's Statistical Software,''
##  and
##    Kosuke Imai, Gary King, and Olivia Lau. (2008).
##    ``Toward A Common Framework for Statistical Analysis
##    and Development,'' Journal of Computational and
##    Graphical Statistics, Vol. 17, No. 4 (December)
##    pp. 892-913. 

##  To cite individual Zelig models, please use the citation format printed with
##  each model run and in the documentation.
##
Error : .onAttach failed in attachNamespace() for 'Zelig', details:
  call: NULL
  error: '.readRDS' is defunct.
Use 'readRDS' instead.
See help("Defunct")
Error: package or namespace load failed for ‘Zelig’
> install.packages(
+ "ZeligMisc",
+ type = "source", lib="C:/Users/Jenny/Documents/R/win-library/3.0"
+ )
Content type 'application/x-gzip' length 10028 bytes
opened URL
downloaded 10028 bytes

* installing *source* package 'ZeligMisc' ...
** R
** inst
** preparing package for lazy loading
Warning: package 'sandwich' was built under R version 3.0.3
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Warning: package 'sandwich' was built under R version 3.0.3
* DONE (ZeligMisc)

The downloaded source packages are in
        ‘C:\Users\Jenny\AppData\Local\Temp\Rtmp8opSG8\downloaded_packages’
> search()
 [1] ".GlobalEnv"        "package:sandwich"  "package:boot"     
 [4] "package:MASS"      "package:gdata"     "package:foreign"  
 [7] "package:stats"     "package:graphics"  "package:grDevices"
[10] "package:utils"     "package:datasets"  "package:methods"  
[13] "Autoloads"         "package:base"     
> library()
> STATA <- read.dta("C:/R/disaggvote2.dta", convert.factors = FALSE)
> View(STATA)
> z.out <- zelig(cbind(ndc04, npp04, thirdparty04, reject04, novote04) ~ agona + ahafo + ahanta + akuapem + akwamu + akyem + aowin + asante + asen + boron + chokosi + denkyira + evalue + fante + kwahu + nzema + sefwi + wasa + bawle + otherakan + allga + allewe + allguan + allgurma + allmole + allgrusi + allmande + allothers + allmissing, COVAR = NULL, model = "ei.RxC", data = STATA)
Error: could not find function "zelig"
> library(ZeligMisc)
Loading required package: Zelig
## 
##  Zelig (Version 4.2-2, built: 2013-10-22)
##  Please refer to http://gking.harvard.edu/zelig for full
##  documentation or help.zelig() for help with commands and
##  models supported by Zelig.
##

##  Zelig project citations:
##    Kosuke Imai, Gary King, and Olivia Lau. (2009).
##    ``Zelig: Everyone's Statistical Software,''
##  and
##    Kosuke Imai, Gary King, and Olivia Lau. (2008).
##    ``Toward A Common Framework for Statistical Analysis
##    and Development,'' Journal of Computational and
##    Graphical Statistics, Vol. 17, No. 4 (December)
##    pp. 892-913. 

##  To cite individual Zelig models, please use the citation format printed with
##  each model run and in the documentation.
##
Error : .onAttach failed in attachNamespace() for 'Zelig', details:
  call: NULL
  error: '.readRDS' is defunct.
Use 'readRDS' instead.
See help("Defunct")
Error: package ‘Zelig’ could not be loaded
> library()
> help.zelig()
Error: could not find function "help.zelig"



--
PhD Candidate
Department of Political Science
University of Florida
PO Box 117325
Gainesville, FL 32611-7325
<div><div dir="ltr">
<p class="MsoNormal">Hi Zelig,</p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">I&rsquo;m having trouble loading the Zelig package to my machine.
My goal is to use the ei.RxC model, but I can&rsquo;t get access Zelig to begin with.
</p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">I installed the Zelig 4.2-1 version, but when I call
library(Zelig), I get an error:</p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">Error : .onAttach failed in attachNamespace() for 'Zelig',
details:</p>

<p class="MsoNormal">&nbsp; call: NULL</p>

<p class="MsoNormal">&nbsp; error: '.readRDS' is
defunct.</p>

<p class="MsoNormal">Use 'readRDS' instead.</p>

<p class="MsoNormal">See help("Defunct")</p>

<p class="MsoNormal">Error: package or namespace load failed for &lsquo;Zelig&rsquo;</p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">I also rolled back Zelig to version 3.5 on the hopes
that it would work, but no change.</p>
<p class="MsoNormal"></p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">I have been following the installation guide (<a href="http://zeligdev.github.io/files/zelig.pdf">http://zeligdev.github.io/files/zelig.pdf</a>), among many other resources, and I am using R version 3.0.2.</p>

<p class="MsoNormal"><br></p>
<p class="MsoNormal">I have also noticed others have had this problem in the past (<a href="http://comments.gmane.org/gmane.comp.lang.r.zelig/783">http://comments.gmane.org/gmane.comp.lang.r.zelig/783</a>) but downloading from the CRAN Network as opposed to manually with an install.packages() command made no difference in my case.</p>

<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><br></p>

<p class="MsoNormal">Please any advice on what I am doing wrong here?</p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">Thanks,</p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">Jennifer Boylan</p>
<div><br></div>
<div>For reference purposes, these are the packages I have loaded in my libraries:</div>
<div>
<div>Packages in library &lsquo;C:/Users/Jenny/Documents/R/win-library/3.0&rsquo;:</div>

<div><br></div>
<div>car &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Companion to Applied Regression</div>
<div>coda &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Output analysis and diagnostics for MCMC</div>
<div>colorspace &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Color Space Manipulation</div>
<div>
Defaults &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Create Global Function Defaults</div>
<div>effects &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Effect Displays for Linear, Generalized Linear,</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Multinomial-Logit, Proportional-Odds Logit</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Models and Mixed-Effects Models</div>

<div>eiPack &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;eiPack: Ecological Inference and</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Higher-Dimension Data Management</div>
<div>expm &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Matrix exponential</div>
<div>gdata &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Various R programming tools for data</div>

<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; manipulation</div>
<div>gee &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Generalized Estimation Equation solver</div>
<div>gmodels &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Various R programming tools for model fitting</div>
<div>gtools &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Various R programming tools</div>

<div>lattice &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Lattice Graphics</div>
<div>lme4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Linear mixed-effects models using Eigen and S4</div>
<div>lmtest &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Testing Linear Regression Models</div>
<div>manipulate &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Interactive Plots for RStudio</div>

<div>markdown &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Markdown rendering for R</div>
<div>Matrix &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Sparse and Dense Matrix Classes and Methods</div>
<div>matrixcalc &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Collection of functions for matrix calculations</div>
<div>

MCMCpack &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Markov chain Monte Carlo (MCMC) Package</div>
<div>mgcv &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Mixed GAM Computation Vehicle with GCV/AIC/REML</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; smoothness estimation</div>
<div>mime &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Map filenames to MIME types</div>

<div>minqa &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Derivative-free optimization algorithms by</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; quadratic approximation</div>
<div>msm &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Multi-state Markov and hidden Markov models in</div>
<div>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continuous time</div>
<div>mvtnorm &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Multivariate Normal and t Distributions</div>
<div>nlme &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Linear and Nonlinear Mixed Effects Models</div>
<div>nnet &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Feed-forward Neural Networks and Multinomial</div>

<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Log-Linear Models</div>
<div>quantmod &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Quantitative Financial Modelling Framework</div>
<div>Rcpp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Seamless R and C++ Integration</div>
<div>RcppEigen &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Rcpp integration for the Eigen templated linear</div>

<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; algebra library.</div>
<div>RMark &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; R Code for MARK Analysis</div>
<div>rstudio &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tools and Utilities for RStudio</div>
<div>sandwich &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Robust Covariance Matrix Estimators</div>

<div>sem &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Structural Equation Models</div>
<div>sfsmisc &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Utilities from Seminar fuer Statistik ETH</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Zurich</div>
<div>snow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Simple Network of Workstations</div>

<div>snowfall &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Easier cluster computing (based on snow).</div>
<div>systemfit &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Estimating Systems of Simultaneous Equations</div>
<div>TTR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Technical Trading Rules</div>
<div>VGAM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Vector Generalized Linear and Additive Models</div>

<div>xts &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; eXtensible Time Series</div>
<div>Zelig &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Everyone's Statistical Software</div>
<div>ZeligMisc &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A Zelig Model</div>
<div>ZeligMultilevel &nbsp; &nbsp; &nbsp; &nbsp; Multilevel Regressions for Zelig</div>

<div>zoo &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; S3 Infrastructure for Regular and Irregular</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Time Series (Z's ordered observations)</div>
<div><br></div>
<div>Packages in library &lsquo;C:/Program Files/R/R-3.0.2/library&rsquo;:</div>

<div><br></div>
<div>base &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;The R Base Package</div>
<div>boot &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Bootstrap Functions (originally by Angelo Canty</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for S)</div>
<div>class &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Functions for Classification</div>

<div>cluster &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Cluster Analysis Extended Rousseeuw et al.</div>
<div>codetools &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Code Analysis Tools for R</div>
<div>compiler &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;The R Compiler Package</div>
<div>datasets &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;The R Datasets Package</div>

<div>foreign &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Read Data Stored by Minitab, S, SAS, SPSS,</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Stata, Systat, dBase, ...</div>
<div>graphics &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;The R Graphics Package</div>
<div>grDevices &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; The R Graphics Devices and Support for Colours</div>

<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and Fonts</div>
<div>grid &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;The Grid Graphics Package</div>
<div>KernSmooth &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Functions for kernel smoothing for Wand &amp; Jones</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (1995)</div>

<div>lattice &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Lattice Graphics</div>
<div>MASS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Support Functions and Datasets for Venables and</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Ripley's MASS</div>
<div>Matrix &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Sparse and Dense Matrix Classes and Methods</div>

<div>methods &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Formal Methods and Classes</div>
<div>mgcv &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Mixed GAM Computation Vehicle with GCV/AIC/REML</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; smoothness estimation</div>
<div>nlme &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Linear and Nonlinear Mixed Effects Models</div>

<div>nnet &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Feed-forward Neural Networks and Multinomial</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Log-Linear Models</div>
<div>parallel &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Support for Parallel computation in R</div>
<div>rpart &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Recursive Partitioning</div>

<div>spatial &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Functions for Kriging and Point Pattern</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Analysis</div>
<div>splines &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Regression Spline Functions and Classes</div>
<div>stats &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; The R Stats Package</div>

<div>stats4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Statistical Functions using S4 Classes</div>
<div>survival &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Survival Analysis</div>
<div>tcltk &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tcl/Tk Interface</div>
<div>tools &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tools for Package Development</div>

<div>translations &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;The R Translations Package</div>
<div>utils &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; The R Utils Package</div>
</div>
<div><br></div>
<div><br></div>
<div>Finally, some sample script:</div>
<div>
<div><br></div>
<div>&nbsp;&gt; install.packages(</div>

<div>&nbsp;"Zelig",</div>
<div>&nbsp;repos = "<a href="http://r.iq.harvard.edu">http://r.iq.harvard.edu</a>",</div>
<div>&nbsp;type = "source", lib="C:/Users/Jenny/Documents/R/win-library/3.0"</div>

<div>&nbsp;)</div>
<div>trying URL '<a href="http://r.iq.harvard.edu/src/contrib/Zelig_4.2-2.tar.gz">http://r.iq.harvard.edu/src/contrib/Zelig_4.2-2.tar.gz</a>'</div>
<div>Content type 'application/x-gzip' length 3269527 bytes (3.1 Mb)</div>

<div>opened URL</div>
<div>downloaded 3.1 Mb</div>
<div><br></div>
<div>* installing *source* package 'Zelig' ...</div>
<div>** R</div>
<div>** data</div>
<div>** demo</div>
<div>** inst</div>
<div>** preparing package for lazy loading</div>

<div>Warning: package 'sandwich' was built under R version 3.0.3</div>
<div>** help</div>
<div>*** installing help indices</div>
<div>** building package indices</div>
<div>** installing vignettes</div>
<div>** testing if installed package can be loaded</div>

<div>Warning: package 'sandwich' was built under R version 3.0.3</div>
<div>* DONE (Zelig)</div>
<div><br></div>
<div>The downloaded source packages are in</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &lsquo;C:\Users\Jenny\AppData\Local\Temp\Rtmp8opSG8\downloaded_packages&rsquo;</div>

<div>&gt; library(Zelig)</div>
<div>##&nbsp;</div>
<div>## &nbsp;Zelig (Version 4.2-2, built: 2013-10-22)</div>
<div>## &nbsp;Please refer to <a href="http://gking.harvard.edu/zelig">http://gking.harvard.edu/zelig</a> for full</div>
<div>## &nbsp;documentation or help.zelig() for help with commands and</div>

<div>## &nbsp;models supported by Zelig.</div>
<div>##</div>
<div><br></div>
<div>## &nbsp;Zelig project citations:</div>
<div>## &nbsp; &nbsp;Kosuke Imai, Gary King, and Olivia Lau. (2009).</div>
<div>## &nbsp; &nbsp;``Zelig: Everyone's Statistical Software,''</div>

<div>## &nbsp; &nbsp;<a href="http://gking.harvard.edu/zelig">http://gking.harvard.edu/zelig</a>.</div>
<div>## &nbsp;and</div>
<div>## &nbsp; &nbsp;Kosuke Imai, Gary King, and Olivia Lau. (2008).</div>
<div>## &nbsp; &nbsp;``Toward A Common Framework for Statistical Analysis</div>

<div>## &nbsp; &nbsp;and Development,'' Journal of Computational and</div>
<div>## &nbsp; &nbsp;Graphical Statistics, Vol. 17, No. 4 (December)</div>
<div>## &nbsp; &nbsp;pp. 892-913.&nbsp;</div>
<div><br></div>
<div>## &nbsp;To cite individual Zelig models, please use the citation format printed with</div>

<div>## &nbsp;each model run and in the documentation.</div>
<div>##</div>
<div>Error : .onAttach failed in attachNamespace() for 'Zelig', details:</div>
<div>&nbsp; call: NULL</div>
<div>&nbsp; error: '.readRDS' is defunct.</div>

<div>Use 'readRDS' instead.</div>
<div>See help("Defunct")</div>
<div>Error: package or namespace load failed for &lsquo;Zelig&rsquo;</div>
<div>&gt; library()</div>
<div>&gt; help.zelig(ei.RxC)</div>
<div>Error: could not find function "help.zelig"</div>

<div>&gt; ?help.zelig()</div>
<div>Error in .helpForCall(topicExpr, parent.frame()) :&nbsp;</div>
<div>&nbsp; no methods for &lsquo;help.zelig&rsquo; and no documentation for it as a function</div>
<div>&gt; ??help.zelig()</div>
<div>&gt; demo(package="Zelig")</div>

<div>&gt; library(Zelig)</div>
<div>##&nbsp;</div>
<div>## &nbsp;Zelig (Version 4.2-2, built: 2013-10-22)</div>
<div>## &nbsp;Please refer to <a href="http://gking.harvard.edu/zelig">http://gking.harvard.edu/zelig</a> for full</div>
<div>## &nbsp;documentation or help.zelig() for help with commands and</div>

<div>## &nbsp;models supported by Zelig.</div>
<div>##</div>
<div><br></div>
<div>## &nbsp;Zelig project citations:</div>
<div>## &nbsp; &nbsp;Kosuke Imai, Gary King, and Olivia Lau. (2009).</div>
<div>## &nbsp; &nbsp;``Zelig: Everyone's Statistical Software,''</div>

<div>## &nbsp; &nbsp;<a href="http://gking.harvard.edu/zelig">http://gking.harvard.edu/zelig</a>.</div>
<div>## &nbsp;and</div>
<div>## &nbsp; &nbsp;Kosuke Imai, Gary King, and Olivia Lau. (2008).</div>
<div>## &nbsp; &nbsp;``Toward A Common Framework for Statistical Analysis</div>

<div>## &nbsp; &nbsp;and Development,'' Journal of Computational and</div>
<div>## &nbsp; &nbsp;Graphical Statistics, Vol. 17, No. 4 (December)</div>
<div>## &nbsp; &nbsp;pp. 892-913.&nbsp;</div>
<div><br></div>
<div>## &nbsp;To cite individual Zelig models, please use the citation format printed with</div>

<div>## &nbsp;each model run and in the documentation.</div>
<div>##</div>
<div>Error : .onAttach failed in attachNamespace() for 'Zelig', details:</div>
<div>&nbsp; call: NULL</div>
<div>&nbsp; error: '.readRDS' is defunct.</div>

<div>Use 'readRDS' instead.</div>
<div>See help("Defunct")</div>
<div>Error: package or namespace load failed for &lsquo;Zelig&rsquo;</div>
<div>&gt; install.packages(</div>
<div>+ "ZeligMisc",</div>
<div>+ repos = "<a href="http://r.iq.harvard.edu">http://r.iq.harvard.edu</a>",</div>

<div>+ type = "source", lib="C:/Users/Jenny/Documents/R/win-library/3.0"</div>
<div>+ )</div>
<div>trying URL '<a href="http://r.iq.harvard.edu/src/contrib/ZeligMisc_0.1-2.tar.gz">http://r.iq.harvard.edu/src/contrib/ZeligMisc_0.1-2.tar.gz</a>'</div>

<div>Content type 'application/x-gzip' length 10028 bytes</div>
<div>opened URL</div>
<div>downloaded 10028 bytes</div>
<div><br></div>
<div>* installing *source* package 'ZeligMisc' ...</div>
<div>** R</div>
<div>

** inst</div>
<div>** preparing package for lazy loading</div>
<div>Warning: package 'sandwich' was built under R version 3.0.3</div>
<div>** help</div>
<div>*** installing help indices</div>
<div>** building package indices</div>

<div>** installing vignettes</div>
<div>** testing if installed package can be loaded</div>
<div>Warning: package 'sandwich' was built under R version 3.0.3</div>
<div>* DONE (ZeligMisc)</div>
<div><br></div>
<div>The downloaded source packages are in</div>

<div>&nbsp; &nbsp; &nbsp; &nbsp; &lsquo;C:\Users\Jenny\AppData\Local\Temp\Rtmp8opSG8\downloaded_packages&rsquo;</div>
<div>&gt; search()</div>
<div>&nbsp;[1] ".GlobalEnv" &nbsp; &nbsp; &nbsp; &nbsp;"package:sandwich" &nbsp;"package:boot" &nbsp; &nbsp;&nbsp;</div>
<div>&nbsp;[4] "package:MASS" &nbsp; &nbsp; &nbsp;"package:gdata" &nbsp; &nbsp; "package:foreign" &nbsp;</div>

<div>&nbsp;[7] "package:stats" &nbsp; &nbsp; "package:graphics" &nbsp;"package:grDevices"</div>
<div>[10] "package:utils" &nbsp; &nbsp; "package:datasets" &nbsp;"package:methods" &nbsp;</div>
<div>[13] "Autoloads" &nbsp; &nbsp; &nbsp; &nbsp; "package:base" &nbsp; &nbsp;&nbsp;</div>

<div>&gt; library()</div>
<div>&gt; STATA &lt;- read.dta("C:/R/disaggvote2.dta", convert.factors = FALSE)</div>
<div>&gt; View(STATA)</div>
<div>&gt; z.out &lt;- zelig(cbind(ndc04, npp04, thirdparty04, reject04, novote04) ~ agona + ahafo + ahanta + akuapem + akwamu + akyem + aowin + asante + asen + boron + chokosi + denkyira + evalue + fante + kwahu + nzema + sefwi + wasa + bawle + otherakan + allga + allewe + allguan + allgurma + allmole + allgrusi + allmande + allothers + allmissing, COVAR = NULL, model = "ei.RxC", data = STATA)</div>

<div>Error: could not find function "zelig"</div>
<div>&gt; library(ZeligMisc)</div>
<div>Loading required package: Zelig</div>
<div>##&nbsp;</div>
<div>## &nbsp;Zelig (Version 4.2-2, built: 2013-10-22)</div>
<div>## &nbsp;Please refer to <a href="http://gking.harvard.edu/zelig">http://gking.harvard.edu/zelig</a> for full</div>

<div>## &nbsp;documentation or help.zelig() for help with commands and</div>
<div>## &nbsp;models supported by Zelig.</div>
<div>##</div>
<div><br></div>
<div>## &nbsp;Zelig project citations:</div>
<div>## &nbsp; &nbsp;Kosuke Imai, Gary King, and Olivia Lau. (2009).</div>

<div>## &nbsp; &nbsp;``Zelig: Everyone's Statistical Software,''</div>
<div>## &nbsp; &nbsp;<a href="http://gking.harvard.edu/zelig">http://gking.harvard.edu/zelig</a>.</div>
<div>## &nbsp;and</div>
<div>## &nbsp; &nbsp;Kosuke Imai, Gary King, and Olivia Lau. (2008).</div>

<div>## &nbsp; &nbsp;``Toward A Common Framework for Statistical Analysis</div>
<div>## &nbsp; &nbsp;and Development,'' Journal of Computational and</div>
<div>## &nbsp; &nbsp;Graphical Statistics, Vol. 17, No. 4 (December)</div>
<div>## &nbsp; &nbsp;pp. 892-913.&nbsp;</div>

<div><br></div>
<div>## &nbsp;To cite individual Zelig models, please use the citation format printed with</div>
<div>## &nbsp;each model run and in the documentation.</div>
<div>##</div>
<div>Error : .onAttach failed in attachNamespace() for 'Zelig', details:</div>

<div>&nbsp; call: NULL</div>
<div>&nbsp; error: '.readRDS' is defunct.</div>
<div>Use 'readRDS' instead.</div>
<div>See help("Defunct")</div>
<div>Error: package &lsquo;Zelig&rsquo; could not be loaded</div>
<div>&gt; library()</div>

<div>&gt; help.zelig()</div>
<div>Error: could not find function "help.zelig"</div>
</div>
<div><br></div>
<div><br></div>
<div><br></div>-- <br>PhD Candidate<br>Department of Political Science<br>University of Florida<br>

PO Box 117325<br>Gainesville, FL 32611-7325
</div></div>
Elinor | 26 Jul 01:27 2014

Cannot load Zelig

Hello,
I cannot seem to load the Zelig package. I get the following error message
when trying to load it:

library(Zelig)
Loading required package: boot
Loading required package: MASS
Loading required package: sandwich
Error : .onAttach failed in attachNamespace() for 'Zelig', details:
  call: packageDescription(package.name, lib.loc = mylib)$Version
  error: $ operator is invalid for atomic vectors
In addition: Warning message:
In packageDescription(package.name, lib.loc = mylib) :
  no package 'Zelig' was found
Error: package or namespace load failed for ‘Zelig’

Any idea how I can get it to work? I am using R version 3.1.1.
Thanks,
Elinor

-
--
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
Ryan Turner | 25 Jul 23:15 2014
Picon

Zelig 5?

Dear Zelig List:

Can anybody comment on the status of Zelig 5?  The Zelig website indicates a "Spring - Summer 2014" release,
though it looks like it hasn't been updated in a while (Documentation page says Zelig Documentation will
be updated summer 2013).  I found the Zelig 5 github repository, and it looks like there has been a lot of work
done.  Is the dev version considered stable and safe or is it still alpha/early beta?

For reasons I don't perfectly recall, I had to downgrade from Zelig 4.2.1 to 3.5.4.  On a recent rebuild of my R
library I thought it was time to look back into this issue.

Thanks,
Ryan

--
Ryan J. Turner, M.S. <rjturner@...>
Ph.D. Candidate, Dept. of Engineering and Public Policy
Carnegie Mellon University & Instituto Superior Técnico
+1-412-304-5014 (C) | +1-484-483-3244 (GV)

Héctor Bahamonde | 18 Jul 18:24 2014
Picon

Re: Question regarding "plot(z.out)"

Hello, I think I figured it out… 

thanks.

##############################
# match.data <- matchit(...)
# model.1 <- zelig(...match.data...)

treat.r <- c(0, 1)
model.treat <- setx(model.1, treat = treat.r)
model.treat.s <- sim(model.1, x = Model.treat)
model.treat.e <- data.frame(simulation.matrix(model.treat.s, "Expected Values: Y|X"))


X1 <- model.treat.e$X1
X2 <- model.treat.e$X2

density.plot <- ggplot() + geom_density(aes(x=X1), data= model.treat.e,  fill="grey", alpha = .5) 
        + geom_density(aes(x=X2), data=model.treat.e, fill="dark grey", alpha = .5) 

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


On 18Jul, 2014, at 12:00 PM, zelig-request <at> lists.gking.harvard.edu wrote:

Send Zelig mailing list submissions to
zelig-boHuZhbfW+Y6DHxCPSz5rMrP0aXywZMx@public.gmane.orgu

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.gking.harvard.edu/mailman/listinfo/zelig
or, via email, send a message with subject or body 'help' to
zelig-request-boHuZhbfW+Y6DHxCPSz5rL5+avTOL6Rl@public.gmane.org

You can reach the person managing the list at
zelig-owner-boHuZhbfW+Y6DHxCPSz5rL5+avTOL6Rl@public.gmane.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Zelig digest..."


Today's Topics:

  1. Question regarding "plot(z.out)" (Hector Bahamonde)


----------------------------------------------------------------------

Message: 1
Date: Tue, 8 Jul 2014 10:17:52 -0400
From: Hector Bahamonde <hib6-nChP9VK/LToysehGhLVACCmkPJUwDNjP@public.gmane.org>
To: zelig-boHuZhbfW+Y6DHxCPSz5rL5+avTOL6Rl@public.gmane.org
Subject: [zelig] Question regarding "plot(z.out)"
Message-ID:
<CAOXA_80sDPRCr31j+FNBno_QBqXnP0E33t0gw7v3Oq+PGW_QBA-JsoAwUIsXotQFR93xxRIaA@public.gmane.orgcom>
Content-Type: text/plain; charset="utf-8"

Dear all,

I am very new to R and I am trying to plot the simulations Zelig performs.
I know about the "plot(z.out)" syntax, but I am only interested in plotting
the ?Comparison of E(Y|X) and  E(Y|X1)? plot. Is that possible? My final
goal is to plot it using the ggplot2 library.

Thanks,
Hector

--
*H?ctor Bahamonde N.*
PhD Student
Political Science Department - Rutgers University
Hickman Hall, 89 George street, room 602.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gking.harvard.edu/pipermail/zelig/attachments/20140708/a0d26be2/attachment-0001.html>

------------------------------

_______________________________________________
Zelig mailing list
Zelig-boHuZhbfW+Y6DHxCPSz5rL5+avTOL6Rl@public.gmane.org

To unsubscribe from this list or get other information:

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

End of Zelig Digest, Vol 157, Issue 1
*************************************



--
Héctor Bahamonde N.
PhD Student
Political Science Department - Rutgers University
Hickman Hall, 89 George street, room 602.

<div>
<div>Hello, I think I figured it out&hellip;&nbsp;</div>
<div><br></div>
<div>thanks.</div>
<div><br></div>
<div>##############################</div>
<div>
<div># match.data &lt;- matchit(...)</div>
<div># model.1 &lt;- zelig(...match.data...)</div>
<div><br></div>
<div>treat.r &lt;- c(0, 1)</div>
<div>model.treat &lt;- setx(model.1, treat = treat.r)</div>
<div>model.treat.s &lt;- sim(model.1, x = Model.treat)</div>
<div>model.treat.e &lt;- data.frame(simulation.matrix(model.treat.s, "Expected Values: Y|X"))</div>
<div><br></div>
<div><br></div>
<div>X1 &lt;- model.treat.e$X1</div>
<div>X2 &lt;- model.treat.e$X2</div>
<div><br></div>
<div>density.plot &lt;- ggplot() <span class="Apple-tab-span">	</span>+ geom_density(aes(x=X1), data= model.treat.e, &nbsp;fill="grey", alpha = .5)&nbsp;</div>
<div>
<span class="Apple-tab-span">							</span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;+ geom_density(aes(x=X2), data=model.treat.e, fill="dark grey", alpha = .5)&nbsp;</div>
</div>
<div><br></div>
<div>##############################</div>
<div><br></div>
<br><div>
<div>On 18Jul, 2014, at 12:00 PM, <a href="mailto:zelig-request@...">zelig-request <at> lists.gking.harvard.edu</a> wrote:</div>
<br class="Apple-interchange-newline"><div>Send Zelig mailing list submissions to<br><span class="Apple-tab-span">	</span><a href="mailto:zelig@...">zelig@...u</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br><span class="Apple-tab-span">	</span>https://lists.gking.harvard.edu/mailman/listinfo/zelig<br>or, via email, send a message with subject or body 'help' to<br><span class="Apple-tab-span">	</span>zelig-request@...<br><br>You can reach the person managing the list at<br><span class="Apple-tab-span">	</span>zelig-owner@...<br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of Zelig digest..."<br><br><br>Today's Topics:<br><br> &nbsp;&nbsp;1. Question regarding "plot(z.out)" (Hector Bahamonde)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Tue, 8 Jul 2014 10:17:52 -0400<br>From: Hector Bahamonde &lt;hib6@...&gt;<br>To: zelig@...<br>Subject: [zelig] Question regarding "plot(z.out)"<br>Message-ID:<br><span class="Apple-tab-span">	</span>&lt;CAOXA_80sDPRCr31j+FNBno_QBqXnP0E33t0gw7v3Oq+PGW_QBA@...com&gt;<br>Content-Type: text/plain; charset="utf-8"<br><br>Dear all,<br><br>I am very new to R and I am trying to plot the simulations Zelig performs.<br>I know about the "plot(z.out)" syntax, but I am only interested in plotting<br>the ?Comparison of E(Y|X) and &nbsp;E(Y|X1)? plot. Is that possible? My final<br>goal is to plot it using the ggplot2 library.<br><br>Thanks,<br>Hector<br><br>-- <br>*H?ctor Bahamonde N.*<br>PhD Student<br>Political Science Department - Rutgers University<br>Hickman Hall, 89 George street, room 602.<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: &lt;http://lists.gking.harvard.edu/pipermail/zelig/attachments/20140708/a0d26be2/attachment-0001.html&gt;<br><br>------------------------------<br><br>_______________________________________________<br>Zelig mailing list<br>Zelig@...<br><br>To unsubscribe from this list or get other information:<br><br>https://lists.gking.harvard.edu/mailman/listinfo/zelig<br><br>End of Zelig Digest, Vol 157, Issue 1<br>*************************************<br>
</div>
</div>
<br><div apple-content-edited="true">
<div><div><div><div><div>
<br><br><span>--</span><br><span>H&eacute;ctor Bahamonde N.</span><br><span>PhD Student</span><br><span>Political Science Department -&nbsp;</span><span>Rutgers University</span><div><span>Hickman Hall, 89 George street, room 602.</span></div>
<div>
<a href="http://www.hectorbahamonde.com">http://www.hectorbahamonde.com</a><span><br></span><br><br><br><br>
</div>
</div></div></div></div></div>
</div>
<br>
</div>

Gmane