Gary King Homepage Previous: A Brief Summary of Up: A Brief Summary of Next: 2. The preliminary analysis.

1. Reading in data and defining the model.

When reading in data you will also be defining the terms in your model, such as the dependent and predictor variables. The commands used for reading in data include YVOTE, YVOTE2, XVARS, XVARS2, and XNEW. Each has a different purpose, but all have a similar syntax. The most important thing to remember about reading in data is that once you issue a YVOTE command, all the previous data in memory is wiped out before anything is read. Thus, when you define the data before the analysis of each election, be sure to define YVOTE first.

Suppose, for example, that you wish to evaluate an electoral system for an election that has occurred already. You therefore need to define the dependent variable (which we do with command YVOTE) and a set of predictor variables (which requires command XVARS). Each of these commands follows a similar syntax, with a keyword (YVOTE and XVARS respectively), a variable name (or names), and a $ <$ sign, followed by the Gauss dataset name and a semicolon. YVOTE also requires you to specify the year of the election. For example:
YVOTE 1988 dem88 $ <$ cong88;
XVARS incum uncontst $ <$ cong88;.
The datasets do not have to be the same. If you have your explanatory variables in more than one file, you may issue multiple XVARS commands. For example:
YVOTE 1988 dem88 $ <$ cong88;
XVARS incum uncontst $ <$cong88;
XVARS cpgspend dem86 $ <$ cong86;.
The data are read in the order of the commands you issue.

The commands used to read in data are summarized here briefly:

YVOTE
The YVOTE command deletes all variables from memory and either reads in a dependent (vote proportion) variable or specifies that a prediction is desired. It is required before any analysis can be conducted. YVOTE also has a syntax to indicate that you are doing prediction.

YVOTE2
The main use of the YVOTE2 command is to specify the dependent variable in the regression run by PRELIM, used to estimate the LAMBDA parameter. In most cases, this variable will contain the results of the election that follows the one used in YVOTE. It is also used by the DISTS command to evaluate model predictions and district-level results. Note: if you do not have the following election for any particular case, do not enter a YVOTE2; PRELIM will know not to use this election in estimating LAMBDA.

XVARS
The variables read in with this command are used as explanatory variables in the analysis procedures. At a minimum, we recommend that you include the following variables, when available: (1) vote proportion in the previous election year, (2) a variable indicating which of the candidates is the incumbent (coded $ -1$ if Republican incumbent, 0 if open seat, and 1 if Democratic incumbent), (3) a variable indicating whether an election is uncontested (coded $ -1$ if the Republican runs unopposed, 0 if the election is contested, and 1 if the Democrat runs unopposed). (This information can be created with the UNC! operator described below), and (4) a partisan control variable (which can be created with the PTY! operator described below). If you have votes for other statewide or nationwide offices broken down into the legislative districts you are analyzing-or if you have other relevant district-level information such as campaign spending or the composition of the minority population in each district-this usually improves predictive power.

XVARS2
The variables read in with this command are added to the variables in the XVARS command by the PRELIM procedure as additional control variables for estimating LAMBDA. Although you could quite reasonably not use this command at all, we recommend doing most analyses conditional on at least incumbency status and uncontestedness. In that case, XVARS2 would include these variables, measured at the election implied by the YVOTE2 command (the one following the election specified by the YVOTE command).

XNEW
The variables read in with this command are for prediction or analysis of an election for which you have hypothetical data indicating counterfactual conditions. For example, you could use this command to analyze an election under the assumption that no incumbents were to run for reelection. Each variable in the XNEW command corresponds to a variable specified in the same order in the most recent XVARS command. Both XVARS and XNEW define a single model for counterfactual evaluation; using XVARS only specifies evaluation under actual conditions; and, using only XNEW is required for prediction.



Gary King 2006-01-07