Coxph in zelig

I am an HMS student trying to implement the "coxph" model in zelig. The most recent version appears not to have this implemented, as it gives the error:

> ** The model "coxph" is not available with the currently loaded packages, > ** and is not an official Zelig package. > ** The model's name may be a typo.

After sleuthing, I found that an older version of Zelig 3.5.4 does have it implemented and have been running my analyses using this version. I am at the stage where I might submit my findings to a conference and wanted to double-check that the results should not be grossly wrong with the older version.

Thanks so much for your help!

Best,

Sameer

<div><div dir="ltr">
<span>Dear Zelig team,</span><div><br></div>
<div>I am an HMS student trying to implement the "coxph" model in&nbsp;zelig. The most recent version appears not to have this implemented, as it gives the error:</div>
<div><div>&gt; ** The model "coxph" is not available with the currently loaded packages,&nbsp;<br>&gt; ** and is not an official&nbsp;Zelig&nbsp;package.&nbsp;<br>&gt; ** The model's name may be a typo.</div></div>
<div><br></div>
<div>After sleuthing, I found that an older version of&nbsp;Zelig&nbsp;3.5.4 does have it implemented and have been running my analyses using this version. I am at the stage where I might submit my findings to a conference and wanted to double-check that the results should not be grossly wrong with the older version.</div>
<div><br></div>
<div>Thanks so much for your help!</div>
<div>Best,</div>
<div>Sameer</div>
</div></div>

Zelig

We are excited to announce the first version of a complete top-to-bottom rewrite of Zelig: Everyone’s Statistical Software. Zelig is an easy-to-use, free, open source, general purpose statistics program for estimating, interpreting, and presenting results from any statistical method. Zelig turns the power of R, with thousands of open source packages -- but with free ranging syntax, diverse examples, and documentation written for different audiences -- into the same three commands and consistent documentation for every method. Zelig uses R code from many researchers, making it “everyone’s statistical software.” It is the easiest way to learn new methods and use them immediately.

*For users*, Our new architecture makes Zelig more capable, and a much more stable platform. We now have automated code checking, so bugs should be infrequent or fixed automatically. With our new architecture, we will be quickly expanding the range of models included and the available ways to both interpret, diagnose, and evaluate models. We have written functions that will allow old Zelig code using the zelig(), setx() and sim() calls to continue to work in the present version; however, please see the new, simplified ways of implementing these steps in the analysis.

*For model developers and package writers*, the new architecture will make it much more simple to incorporate your model or methods into the Zelig framework, giving your methods more visibility and ease of use. Zelig also now gives you much infrastructure you can use in your package without you having to write it yourself. You will have available all the methods for substantive interpretation (expected values, predicted values, first differences, etc.), test diagnostics (bootstraps, jackknifes, small-sample bias corrections) utilities (seamless integration with multiply imputed data, matched data, weighting) and other features. You can focus on writing new innovative models, and leave all the time consuming pragmatic utilities to help your users to Zelig. Writing the few bridge functions to make your package usable within Zelig will also ensure your packages, methods, and papers get the visibility they deserve.

The present version of Zelig has more than 28 statistical models, and it is set to grow continuously. You can see our whole development path, milestones, and all the new models we plan to add. Please feel free to make requests or add your own; we will update this continuously.

*Mailing List* We are transitioning our long-standing mailing list to a Google group here. We hope you will share your feedback, ideas, concerns or issues in this forum. Also feel free to raise issues on the GitHub issue queue where you can see our progress on features we are developing, and more information about milestones that will mark each upcoming release.

<div><div dir="ltr">We are excited to announce the first version of a complete top-to-bottom rewrite of <a href="http://zeligproject.org" target="_blank">Zelig: Everyone&rsquo;s Statistical Software</a>. Zelig is an easy-to-use, free, open source, general purpose statistics program for estimating, interpreting, and presenting results from any statistical method. Zelig turns the power of R, with thousands of open source packages -- but with free ranging syntax, diverse examples, and documentation written for different audiences -- into the same three commands and consistent documentation for every method. Zelig uses R code from many researchers, making it &ldquo;everyone&rsquo;s statistical software.&rdquo; It is the easiest way to learn new methods and use them immediately.<br><br>More information is at our new project page: &nbsp;<a href="http://zeligproject.org" target="_blank">http://zeligproject.org</a>.<br><br>*For users*, Our new architecture makes Zelig more capable, and a much more stable platform. We now have automated code checking, so bugs should be infrequent or fixed automatically. With our new architecture, we will be quickly expanding the range of models included and the available ways to both interpret, diagnose, and evaluate models.&nbsp; We have written functions that will allow old Zelig code using the zelig(), setx() and sim() calls to continue to work in the present version; however, please see the new, simplified ways of implementing these steps in the analysis. &nbsp;<br><br>*For model developers and package writers*, the new architecture will make it much more simple to incorporate your model or methods into the Zelig framework, giving your methods more visibility and ease of use.&nbsp; Zelig also now gives you much infrastructure you can use in your package without you having to write it yourself. You will have available all the methods for substantive interpretation (expected values, predicted values, first differences, etc.), test diagnostics (bootstraps, jackknifes, small-sample bias corrections) utilities (seamless integration with multiply imputed data, matched data, weighting) and other features. You can focus on writing new innovative models, and leave all the time consuming pragmatic utilities to help your users to Zelig. Writing the few bridge functions to make your package usable within Zelig will also ensure your packages, methods, and papers get the visibility they deserve.<br><br>The present version of Zelig has more than <a href="http://docs.zeligproject.org/en/latest/" target="_blank">28 statistical models</a>, and it is set to grow continuously. You can see our whole <a href="https://github.com/IQSS/Zelig/milestones" target="_blank">development path</a>, milestones, and all the new models we plan to add. Please feel free to make requests or add your own; we will update this continuously.<div>
<br>*Mailing List*&nbsp;We are&nbsp;transitioning our long-standing mailing list to a Google group <a href="https://groups.google.com/forum/?hl=en#!forum/zelig-statistical-software" target="_blank">here</a>.&nbsp; We hope you will share your feedback, ideas, concerns or issues in this forum.&nbsp; Also feel free to raise issues on the <a href="https://github.com/IQSS/Zelig/issues" target="_blank">GitHub issue queue</a>&nbsp;where you can see our progress on features we are developing, and more information about milestones that will mark each upcoming release.<br><br><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">
</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>
<div>
<span>Gary</span><div><span>--</span></div>
<div>
<span>Gary King&nbsp;-&nbsp;</span><span>Albert J. Weatherhead III University Professor - Director,&nbsp;<a href="http://iq.harvard.edu/" target="_blank">IQSS&nbsp;</a>- Harvard University</span>
</div>
<div>
<span><a href="http://garyking.org/" target="_blank">GaryKing.org</a>&nbsp;-</span><span>&nbsp;<a href="mailto:King@..." title="[GMCP] Compose a new mail to King@..." rel="noreferrer" target="_blank">King <at> Harvard.edu</a>&nbsp;-&nbsp;<a href="https://twitter.com/kinggary" target="_blank"> <at> KingGary</a>&nbsp;-&nbsp;<span title="Call with Google Voice"><span title="Call with Google Voice"><span title="Call with Google Voice"><span title="Call with Google Voice"><a href="tel:617-500-7570" value="+16175007570" target="_blank">617-500-7570</a></span></span></span></span>&nbsp;- fax&nbsp;</span><span>812-8581 -&nbsp;<a href="mailto:king-assist@...vard.edu" target="_blank">Assistant</a>:</span><span>&nbsp;495-9271</span>
</div>
</div>
</div></div>

Greetings From Puerto Rico- A consult on Mulpile Imputation Programming

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.

<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>

"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>

Bayesian regression and importance of predictors

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>

adding a covariate to ei.RxC models

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).

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

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>