zelig2: Interface Between Zelig Models and External Functions

Description Value Note Examples

Description

The zelig2 function acts as a simple interface between a user's call to the zelig function and the zelig functions subsequent call to the pre-existing external model. The external model varies based on which model is being called.

Value

The main purpose of the zelig2 function is to return a list of key-value pairs, specifying how Zelig should interface with the external method. This list has the following format:

.function

specifies the name of the external method to be called by zelig function. Subsequent parameters, are called and evaluated as a function call to the function of the named string.

.hook

specifies the name of a hook function as a string. The hook function is only evaluated on zelig object once the external method fits the statistical model

...

any parameters aside from .function and .hook is as part of the function call to the external model

Note

Writing zelig2 functions is required of Zelig developers. In particular, zelig2 functions act as an interface between external models (models not included in the Zelig package) and the zelig function which must use that model.

zelig2 is not an actual function. Rather,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
zelig2some.model <- function (formula, weights, verbose, ..., data) {
   list(
        .function = 'some.other.method',
        .hook = NULL,
        formula = formula,
        weights = 2 * weights,
        data = data
        )
 }

## This \code{zelig2} function equates the following function call:
##  zelig(formula, weights = weights, verbose = TRUE, data = data, model="some.model")
##
## with:
##  some.other.method(formula = formula, weights = 2 * weights, data=data)

## Note that the 'verbose' parameter is ignored, since the
## 'zelig2some.model' does not include the 'verbose' parameter in its return
## value.

IQSS/Zelig4 documentation built on May 9, 2019, 9:13 a.m.