Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Inv

Specify the Reciprocal of a Predictor in a gnm Model Formula


Description

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

Usage

Inv(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 Inv

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

See Also

Examples

## One way to fit the logistic function without conditional
## linearity as in ?nls
library(gnm)
set.seed(1)
DNase1 <- subset(DNase, Run == 1)

test <- gnm(density ~ -1 +
            Mult(1, Inv(Const(1) + Exp(Mult(1 + offset(-log(conc)),
                                                Inv(1))))),
            start = c(NA, 0, 1), data = DNase1, trace = TRUE)
coef(test)

gnm

Generalized Nonlinear Models

v1.1-1
GPL-2 | GPL-3
Authors
Heather Turner [aut, cre] (<https://orcid.org/0000-0002-1256-3375>), David Firth [aut] (<https://orcid.org/0000-0003-0302-2312>), Brian Ripley [ctb], Bill Venables [ctb], Douglas M. Bates [ctb], Martin Maechler [ctb] (<https://orcid.org/0000-0002-8685-9910>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.