nordr {gnlm} | R Documentation |
Nonlinear Ordinal Regression Models
Description
nordr
fits arbitrary nonlinear regression functions (with logistic
link) to ordinal response data by proportional odds, continuation ratio, or
adjacent categories.
Usage
nordr(y = NULL, distribution = "proportional", mu = NULL,
linear = NULL, pmu = NULL, pintercept = NULL, weights = NULL,
envir = parent.frame(), print.level = 0, ndigit = 10,
gradtol = 1e-05, steptol = 1e-05, fscale = 1, iterlim = 100,
typsize = abs(p), stepmax = 10 * sqrt(p %*% p))
Arguments
y |
A vector of ordinal responses, integers numbered from zero to one
less than the number of categories or an object of class, |
distribution |
The ordinal distribution: proportional odds, continuation ratio, or adjacent categories. |
mu |
User-specified function of |
linear |
A formula beginning with ~ in W&R notation, specifying the linear part of the logistic regression function. |
pmu |
Vector of initial estimates for the regression parameters,
including the first intercept. If |
pintercept |
Vector of initial estimates for the contrasts with the first intercept parameter (difference in intercept for successive categories): two less than the number of different ordinal values. |
weights |
Weight vector for use with contingency tables. |
envir |
Environment in which model formulae are to be interpreted or a
data object of class, |
print.level |
Arguments controlling |
ndigit |
Arguments controlling |
gradtol |
Arguments controlling |
steptol |
Arguments controlling |
fscale |
Arguments controlling |
iterlim |
Arguments controlling |
typsize |
Arguments controlling |
stepmax |
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 nordr is returned that contains all of the relevant information calculated, including error codes.
Author(s)
J.K. Lindsey
See Also
finterp
, fmr
,
glm
, glmm
,
gnlmm
, gnlr
,
gnlr3
, nlr
,
ordglm
Examples
# McCullagh (1980) JRSS B42, 109-142
# tonsil size: 2x3 contingency table
y <- c(0:2,0:2)
carrier <- c(rep(0,3),rep(1,3))
carrierf <- gl(2,3,6)
wt <- c(19,29,24,
497,560,269)
pmu <- c(-1,0.5)
mu <- function(p) c(rep(p[1],3),rep(p[1]+p[2],3))
# proportional odds
# with mean function
nordr(y, dist="prop", mu=mu, pmu=pmu, weights=wt, pintercept=1.5)
# using Wilkinson and Rogers notation
nordr(y, dist="prop", mu=~carrierf, pmu=pmu, weights=wt, pintercept=1.5)
# using formula with unknowns
nordr(y, dist="prop", mu=~b0+b1*carrier, pmu=pmu, weights=wt, pintercept=1.5)
# continuation ratio
nordr(y, dist="cont", mu=mu, pmu=pmu, weights=wt, pintercept=1.5)
# adjacent categories
nordr(y, dist="adj", mu=~carrierf, pmu=pmu, weights=wt, pintercept=1.5)
#
# Haberman (1974) Biometrics 30, 589-600
# institutionalized schizophrenics: 3x3 contingency table
y <- rep(0:2,3)
fr <- c(43,6,9,
16,11,18,
3,10,16)
length <- gl(3,3)
## Not run:
# fit continuation ratio model with nordr and as a logistic model
nordr(y, mu=~length, weights=fr, pmu=c(0,-1.4,-2.3), pint=0.13,
dist="cont")
## End(Not run)
# logistic regression with reconstructed table
frcr <- cbind(c(43,16,3,49,27,13),c(6,11,10,9,18,16))
lengthord <- gl(3,1,6)
block <- gl(2,3)
summary(glm(frcr~lengthord+block,fam=binomial))
# note that AICs and deviances are different