Previous: Step 1: Create a Up: Step 1: Create a Next: Voter Formula

Model Formula

The model formula, model.formula, specifies the system's outcome variable -- the proportion of the two-party vote received by the candidate for a specified party -- and any desired predictors, such as incumbency status. The predictor names must be the same as the variable names within the data list (referred to here as elections.)

Functions can also be applied to the variables within the formula. For example, if we wish to create an indicator for whether a win is decisive (for example, the winner more than triples the loser's vote share), we first create such a function,

some.function <- function(arg) -1*(arg<0.25)+1*(arg>0.75)

and then use it in the formula. For example, with data set house6311 this formula works: model.formula=VOTE~INC+some.function(VOTE).



Gary King 2010-08-31