Nonlin {gnm} | R Documentation |
A symbolic wrapper, for use in the formula argument to
gnm
, to indicate a nonlinear term that requires special
handling.
Nonlin(functionCall, data = NULL)
functionCall |
a call to a “plug-in” function that provides the objects required to fit the special nonlinear term. |
data |
(optional) a data.frame containing any variables in
specified arguments of functionCall . |
Nonlinear terms that cannot be specified by Mult
require special
handling by gnm
. Nonlin
provides a way of specifying
such terms in a gnm
formula.
To fit the special terms, gnm
requires certain objects and
functions, which must be produced by a plug-in function. The
functionCall
argument of Nonlin
specifies the call to this function that is
necessary to fit the desired term.
The gnm package includes plug-in functions for multiplicative
interactions with homogeneous effects (MultHomog
) and diagonal
reference terms (Dref
). Users may also define their own plug-in
functions which should return a list with at least the following
three components:
gnm
will prefix the call to the
plug-in function).coef
(a vector of parameter estimates) and
predictor
(the result of the predictor function), and
returns the local design matrix.and optionally one further component
Any variables passed to unspecified arguments of the plug-in function will
be automatically added to the model frame used in gnm
.
This model frame can be accessed within a plug-in function
using getModelFrame
.
The data
argument of Nonlin
can be used to provide any
variables required by specified arguments of the plug-in function.
ALL the variables given in data
will be added to the model frame.
An object of class "Nonlin"
which is a list of deparsed expressions
representing the variables passed to unspecified arguments of the plug-in
function, with the attributes
call |
the call to make to the plug-in function. |
extraData |
if supplied, the data frame passed to the data
argument of Nonlin . |
Heather Turner
Goodman, L. A. (1979) Simple Models for the Analysis of Association in Cross-Classifications having Ordered Categories. J. Am. Stat. Assoc., 74(367), 537-552.
gnm
, getModelFrame
,
MultHomog
, Dref
, Mult
set.seed(1) data(occupationalStatus) ## Fit an association model with homogeneous row-column effects RChomog <- gnm(Freq ~ origin + destination + Diag(origin, destination) + Nonlin(MultHomog(origin, destination)), family = poisson, data = occupationalStatus)