Description Value Note Examples
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.
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:
|
specifies the name of the
external method to be called by |
|
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
|
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,
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.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.