MultHomog {gnm} | R Documentation |
A function to provide the objects and functions required to fit
multiplicative interactions with homogeneous effects in a generalized
nonlinear model using gnm
.
MultHomog(...)
... |
a comma-separated list of two or more factors. |
Designed to work as a plug-in function for gnm
, MultHomog
produces the objects required to fit a multiplicative interaction with
one component in which the constituent multipliers are the effects of
two or more factors and the effects of these factors are constrained
to be equal when the factor levels are equal. Thus the interaction
effect would be
gamma_i gamma_j ...
for an observation with level i of the first factor, level j of the second factor and so on, where gamma_l is the effect for level l of the homogeneous multiplicative factor.
To specify a homogeneous multiplicative interaction in the formula argument
to gnm
, the symbolic wrapper Nonlin
must be used, with a call
to MultHomog
as the first argument.
If the factors passed to MultHomog
do not have exactly the same
levels, the set of levels is taken to be the union of the factor
levels, sorted into increasing order.
A list with the components required of a gnm
plug-in function:
labels |
a character vector of labels for the parameters in the interaction. |
predictor |
a function that takes estimates of the parameters in the interaction and returns the fitted values. |
localDesignFunction |
a function that takes a vector of estimates of the parameters in the interaction and returns the local design matrix. |
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.
Dref
for another gnm
plug-in function.
Mult
for specifying multiplicative interactions in
gnm
formulae.
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) ## Deviance is 32.56, 34 d.f.