Making the Model Compatible with Zelig
You can develop a model, write the model-fitting function, and test it
within the Zelig framework without explicit intervention from the
Zelig team. (We are, of course, happy to respond to any questions or
suggestions for improvement.)
Zelig's modularity relies on two R programming conventions:
- wrappers, which pass arguments from R functions to
other R functions or to foreign function calls (such as C, C++, or
Fortran functions); and
- classes, which tell generic functions how to handle
objects of a given class.
Specific methods for R generic functions take the general form: method.class(), where method is the name of the generic
procedure to be performed and class is the class of the object.
You may define, for example, summary.contrib() to summarize the
output of your model. Note that for S4 classes, the name of generic
functions does not have to be method.class() so long as users
can call them via method().
Subsections
Gary King
2011-11-29