# Standard error / quantiles for percentage change in hazard rate

**Posted:**January 24, 2013

**Filed under:**Post |

**Tags:**function, R, simulation, survival model Leave a comment

Box-Steffensmeier / Jones (2004, 60) suggest in their book “Event History Modeling” to calculate the “percentage change in hazard rate” to simplify the interpretation of estimates from Cox models. The quantity is defined as:

I wrote a little R function for calculating this quantity. Since the coefficients (b) are unknown quantities and can only be estimated, the function takes into account their uncertainty and simulates a distribution of the “percentage change in hazard rate”. The output is the mean and the quantiles of the simulated distribution. Licht (2011) suggested something similar in the context of non-proportional hazard modeling.

The working of the code is pretty simple. 1) Estimate the model, 2) Get the Hessian and coefficient vector, 3) Use them to generate draws from a multivariate normal distribution, 4) Calculate the hazard change quantity for each draw and 5) Estimate the mean and quantiles for this simulated distribution. See King et al (2000) for something similar in the context of other models.

**References**

Box-Steffensmeier, J. M., & Jones, B. S. (2004). Event History Modeling: A Guide for Social Scientists. Cambridge: Cambridge University Press.

Licht, Amanda A. (2011). Change Comes with Time: Substantive Interpretation of Nonproportional Hazards in Event History Analysis. Political Analysis, 19(1), 227-243.

King, G., Tomz, M., & Wittenberg, J. (2000). Making the Most of Statistical Analyses: Improving Interpretation and Presentation. American Journal of Political Science, 44(2), 347-361.

# Update: Version Control for Latex files

**Posted:**January 22, 2013

**Filed under:**Post |

**Tags:**Latex, vc Leave a comment

Github can be used to version control your tex files, which is handy if you are working on a large writing project, e.g. a dissertation. Here is a quick tutorial on how to include a footnote in your compiled tex files that tells you the git commit ID and the commit date. See also my first post here.

Install the `gitinfo`

package for Latex. Next, initialize a new git repository, e.g. via the terminal and `cd`

into the hooks folder.

git init

cd ./.git/hooks

Now, replace the files with these hooks (zip). I built them according to gitinfo package (documentation. Next, include this header into your Latex file:

\usepackage{gitinfo}

\title{Selection, Aggregation and Missing data}

\author{sumtxt\footnote{Last commit: \gitCommitterIsoDate\ Git-Hash: \gitAbbrevHash. Please do not distribute without the permission of the author.}}

and compile the tex files. The footnote (should) now read: “Last commit: 2013-01-03 22:09:06 +0100 Git-Hash: 4b23635. Please do not distribute without the permission of the author.”

**Update (6/19/13):** Some other useful advices here.

# R Function: Calculate unanimity or QMV core size

**Posted:**January 20, 2013

**Filed under:**Uncategorized Leave a comment

I have written a little R function for calculating the one-dimensional unanimity / QMV core size given actors’ preferences and vote-weights. The `core’ is a game-theoretic concept which describes the set of all policies or alternatives that cannot be changed given a specific voting rule. The core is often used to describe how difficult a bargaining situation is for actors. The larger the core, the more diverse the interests, and hence the more difficult the bargaining.

The function, a simple example and data on EU Council voting weights can be found in one of my github repository.