Learn R Programming

gnm (version 0.9-3)

Const: Specify a Constant in a gnm Model Formula

Description

A symbolic wrapper to specify a constant in the formula argument to gnm

Usage

Const(const)

Arguments

const
a numeric value.

Value

  • A call to rep used to create a variable representing the constant in the model frame.

Details

Const is equivalent to offset(rep(const, nObs)) where nObs is the number of observations being modelled.

See Also

gnm, formula, offset

Examples

Run this code
## 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)

Run the code above in your browser using DataLab