Gary King Homepage Previous: What's new in larify Up: Clarify: Software for Interpreting Next: The Main Commands


A Simple Example

$ {\mathfrak{C}}$larify is based on three simple commands:

estsimp (estimates the model and simulates its parameters)
setx (sets values of Xs before simulating quantities of interest)
simqi (simulates quantities of interest)

In general, the commands should be run in that order, although it is often useful to call setx and simqi many times after running estsimp. $ {\mathfrak{C}}$larify also contains two minor commands: sumqi and tlogit. sumqi assists in summarizing quantities of interest that have been saved to the dataset. tlogit applies the logistic transformation to one or more variables. For instructions on using these commands, consult the on-line help file. All $ {\mathfrak{C}}$larify commands can be run interactively at the Stata command line or in batch mode by using a Stata do-file.

Each command contains many options, which we describe in Section 8 of this manual. Here, we offer a simple example designed to show how $ {\mathfrak{C}}$larify can be used. With a dataset loaded into memory, type the following 3 commands:

     estsimp logit Y X1 X2    /* Estimate a logit and simulate its parameters */
     setx mean                /* Set X's to their means.  */
     simqi                    /* Report Pr(Y=1) conditional on the X's */

Each of these commands performs a particular operation, which we summarize here. A more detailed discussion appears in Section 8.

estsimp logit Y X1 X2
$ {\mathfrak{C}}$larify works by capturing and interpreting the statistical results that Stata produces when estimating a particular model. To use $ {\mathfrak{C}}$larify, insert the word estsimp at the beginning of an estimation command that you would normally run in Stata. In this example, the built-in Stata command is logit, the binary dependent variable is $ Y$, and the explanatory variables are $ X1$, $ X2$, and a constant. Unless the user specifies otherwise, estsimp will save the simulated parameters as new variables bearing the names $ b1$, $ b2$, and $ b3$, which will hold simulations of the coefficients on $ X1$, $ X2$, as well as the constant term. If any of the variables $ b1$ through $ b3$ already exist in the dataset, $ {\mathfrak{C}}$larify will ask the user to delete those variables or choose different names for the simulations.

setx mean
The setx command allows the user to choose a real or hypothetical value for each explanatory variable before computing quantities of interest. In this example, the command setx mean sets each $ X$ equal to its average value.

simqi
The simqi command computes and reports quantities of interest and associated measures of uncertainty. Used without specifying any options (many options are possible - see Section 8.3), simqi will compute intelligent default quantities that are appropriate to the model being estimated. In the case of logit, simqi will report the probability that $ Y=1$.



Gary King 2006-01-04