MultHomog {gnm}R Documentation

gnm Plug-in Function to Fit Multiplicative Interactions with Homogeneous Effects

Description

A function to provide the objects and functions required to fit multiplicative interactions with homogeneous effects in a generalized nonlinear model using gnm.

Usage

MultHomog(...)

Arguments

... a comma-separated list of two or more factors.

Details

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.

Value

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.

Note

Currently, MultHomog can only be used to specify a one-dimensional interaction. See examples for a workaround to specify interactions with more than one dimension.

Author(s)

Heather Turner

References

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.

See Also

gnm and Nonlin for usage.

Dref for another gnm plug-in function.

Mult for specifying multiplicative interactions in gnm formulae.

Examples

set.seed(1)
data(friend)

##  Fit an association model with homogeneous row-column effects
rc1 <- gnm(Freq ~ r + c + Diag(r,c) + Nonlin(MultHomog(r, c)),
           family = poisson, data = friend)
rc1

##  Extend to two-component interaction (using workaround)
original <- as.data.frame(friend)
r2 <- original$r
c2 <- original$c
rc2 <- update(rc1, . ~ . + Nonlin(MultHomog(r2, c2)))
rc2

[Package gnm version 0.8-3 Index]