Learn R Programming

Zelig (version 4.2-1)

zelig2: Interface Between Zelig Models and External Functions

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.

Arguments

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:
  • .functionspecifies 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.
  • .hookspecifies 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

Examples

Run this code
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.

Run the code above in your browser using DataLab