Exp: Specify the Exponential of a Predictor in a gnm Model Formula

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Exp.R

Description

A function of class "nonlin" to specify the exponential of a predictor in the formula argument to gnm.

Usage

1
Exp(expression, inst = NULL)

Arguments

expression

a symbolic expression representing the (possibly nonlinear) predictor.

inst

(optional) an integer specifying the instance number of the term.

Details

The 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.

Value

A list with the components required of a "nonlin" function:

predictors

the expression argument passed to Exp

term

a function to create a deparsed mathematical expression of the term, given a label for the predictor.

call

the call to use as a prefix for parameter labels.

Author(s)

Heather Turner and David Firth

See Also

gnm, formula, nonlin.function

Examples

1
2
3
4
5
6
7
8
9
set.seed(1)

## Using 'Mult' with 'Exp' to constrain the first constituent multiplier
##  to be non-negative

## 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))

Example output

Initialising
Running start-up iterations..
Running main iterations.........................................
Done

gnm documentation built on May 29, 2017, 2:22 p.m.