bnlr {gnlm} | R Documentation |
Binomial Nonlinear Regression Models
Description
bnlr
fits user-specified nonlinear regression equations to binomial
data with various link functions (logit
, probit
, comp
log log
, log log
, Cauchy
, Student t
, stable
, or
mixture
). The mixture link is a logistic link with extra probability
mass for y=0
and y=n
.
Usage
bnlr(y = NULL, link = "logit", mu = NULL, linear = NULL,
pmu = NULL, pshape = NULL, wt = 1, envir = parent.frame(),
print.level = 0, typsize = abs(p), ndigit = 10, gradtol = 1e-05,
stepmax = 10 * sqrt(p %*% p), steptol = 1e-05, iterlim = 100,
fscale = 1)
Arguments
y |
A two column matrix of binomial data or censored data or an object
of class, |
link |
A character string containing the name of the link function. The
|
mu |
A user-specified function of |
linear |
A formula beginning with ~ in W&R notation, specifying the linear part of the regression function for the location parameter or list of two such expressions for the location and/or shape parameters. |
pmu |
Vector of initial estimates for the location parameters. If
|
pshape |
If the |
wt |
Weight vector. |
envir |
Environment in which model formulae are to be interpreted or a
data object of class, |
print.level |
Arguments controlling |
typsize |
Arguments controlling |
ndigit |
Arguments controlling |
gradtol |
Arguments controlling |
stepmax |
Arguments controlling |
steptol |
Arguments controlling |
iterlim |
Arguments controlling |
fscale |
Arguments controlling |
Details
Nonlinear regression models can be supplied as formulae where parameters are
unknowns in which case factor variables cannot be used and parameters must
be scalars. (See finterp
.)
The printed output includes the -log likelihood (not the deviance), the corresponding AIC, the maximum likelihood estimates, standard errors, and correlations.
Value
A list of class gnlm
is returned that contains all of the
relevant information calculated, including error codes.
Author(s)
J.K. Lindsey
See Also
Examples
# assay to estimate LD50
y <- c(9,9,10,4,1,0,0)
y <- cbind(y,10-y)
dose <- log10(100/c(2.686,2.020,1.520,1.143,0.860,0.647,0.486))
summary(glm(y~dose, family=binomial))
bnlr(y, mu=~dose, pmu=c(1,1))
summary(glm(y~dose, family=binomial(link=probit)))
bnlr(y, link="probit", mu=~dose, pmu=c(1,1))
## Not run:
bnlr(y, link="log log", mu=~dose, pmu=c(1,1))
bnlr(y, link="comp log log", mu=~dose, pmu=c(1,1))
bnlr(y, link="Cauchy", mu=~dose, pmu=c(60,-30))
bnlr(y, link="Student", mu=~dose, pmu=c(60,-30), pshape=0.1)
bnlr(y, link="stable", mu=~dose, pmu=c(20,-15), pshape=0, stepmax=1)
bnlr(y, link="mixture", mu=~dose, pmu=c(60,-30), pshape=-2.5)
#
mu <- function(p) -p[1]*(log10(p[2])-dose)
bnlr(y, mu=mu, pmu=c(1,100))
bnlr(y, link="probit", mu=mu, pmu=c(1,100))
## End(Not run)