Previous: Zelig Commands Up: Zelig Commands Next: Examples


Quick Overview

For any statistical model, Zelig does its work with a combination of three commands.

Figure: Main Zelig commands (solid arrows) and some options (dashed arrows)
8#8

  1. Use zelig() to run the chosen statistical model on a given data set, with a specific set of variables. For standard likelihood models, for example, this step estimates the coefficients, other model parameters, and a variance-covariance matrix. In addition, you may choose from a variety of options:
  2. Use setx() to set each of the explanatory variables to chosen (actual or counterfactual) values in preparation for calculating quantities of interest. After calling setx(), you may use WhatIf to evaluate these choices by determining whether they involve interpolation (i.e., are inside the convex hull of the observed data) or extrapolation, as well as how far these counterfactuals are from the data. Counterfactuals chosen in setx() that involve extrapolation far from the data can generate considerably more model dependence (see (), (), ()).
  3. Use sim() to draw simulations of your quantity of interest (such as a predicted value, predicted probability, risk ratio, or first difference) from the model. (These simulations may be drawn using an asymptotic normal approximation (the default), bootstrapping, or other methods when available, such as directly from a Bayesian posterior.) After calling sim(), use any of the following to summarize the simulations:
Whenever possible, we use z.out as the zelig() output object, x.out as the setx() output object, and s.out as the sim() output object, but you may choose other names.



Gary King 2011-11-29