Last chance! 50% off unlimited learning
Sale ends in
"nonlin"
to specify the exponential
of a predictor in the formula argument to gnm
.Exp(expression, inst = NULL)
"nonlin"
function:expression
argument passed to Exp
expression
argument is interpreted as the right hand side
of a formula in an object of class "formula"
, except that an
intercept term is not added by default. Any function of class
"nonlin"
may be used in addition to the usual operators and
functions.gnm
, formula
,
nonlin.function
set.seed(1)
## Using 'Mult' with 'Exp' to constrain the first constituent multiplier
## to be non-negative
data(yaish)
## Fit the "UNIDIFF" mobility model across education levels
unidiff <- gnm(Freq ~ educ*orig + educ*dest +
Mult(Exp(educ), orig:dest),
family = poisson, data = yaish, subset = (dest != 7))
Run the code above in your browser using DataLab