Learn R Programming

blm (version 2011.1.3)

lexpit: Fit a binomial linear-expit regression model

Description

A direct probability model for binary data from a prospective cohort study. Covariate effects are the sum of additive terms and an expit term, which allows for some vectors to be additive and others non-linear.

Usage

lexpit(f.linear,f.expit,data,par.init,ineq=NULL,trace=FALSE,
	tol=1e-6,augmented=TRUE,warn=-1,...)

Arguments

f.linear
formula for linear model for binary outcome, event~x1+x2+...
f.expit
formula for expit model, linear in expit, event~z1+z2+...
data
data.frame containing the variables of f.linear and f.expit
par.init
List of linear and expit logical or numeric.
ineq
optional user-specified inequality constraint matrix.
trace
logical, whether optimization details at each outer iteration should be printed.
tol
numeric criterion for judging a constraint active when augmented is FALSE.
augmented
logical, whether the optimization method should use constrained optimization with an augmented Lagrangian (see details).
warn
numerical, passed to options during run. Default suppresses warning messages.
...
Additional argument to control.outer of constrOptim.nl

Value

  • Returns an object of class lexpit.

Details

lexpit like blm is a wrapper for auglag and constrOptim.nl from the alabama package, which performs constrained optimization for nonlinear functions and linear/nonlinear inequality constraints. constrOptim.nl performs the constrained optimization procedure with a interior point adaptive barrier (Lange, 2010). If augmented is TRUE than an augmented Lagrangian method is used (Madsen, 2004). When par.init is not specified an iterative search for feasible starting values using a linear projection from the OLS estimates into the feasible region. If a list is given, it has the named components linear and expit where each is a vector of the same length as the linear and expit parameters. The initial parameters are set equal to the supplied vectors if these are numeric. If logical, they are taken as instructions for setting the specified parameter to zero when TRUE and to use the iterative procedure when FALSE. The ineq matrix for the linear component of the model is determined automatically from the unique covariate patterns of the design matrix contains only the extreme values (endpoints of empirical range) for each column. It can also be supplied directly by the user. In this case, it is a matrix with the rows equal to the number of inequality constraints for the lower bound and the columns corresponding to each column of the model design matrix. When a constraint is at the boundary of the feasible region, the constraint will be approximately zero when evaluated at the final estimates of the algorithm. When using the augmented Lagrangian, an active constraint is defined as one where the multiplier lambda is non-zero. When augmented is FALSE (i.e. classical barrier method is used) tol is the criterion for zero, so any evaluated constraints less than or equal to tol are considered active. If any constraints are active, the covariance-variance based on the Taylor series approximation might be inaccurate. Since the augmented Lagrangian procedure takes into the active constraints into account when computing the Hessian matrix, whose inverse is the covariance-variance of the model estimates, this is the recommended method for estimation at the boundary.

References

Lange, K (2010). Numerical Analysis for Statisticians, Springer. Madsen K, Nielsen HB, Tingleff O (2004). Optimization with Constraints, IMM, DTU,

See Also

blm-class,blm,summary,constrOptim.nl

Examples

Run this code
data(grad)

# EFFECT OF GRE ON UNDERGRAD SCHOOL PRESTIGE ON GRAD ADMISSION
# CONTROLLED FOR SCHOOL RANK

fit <- lexpit(admit~I(scale(gre)),admit~factor(rank),grad)

fit 

summary(fit)

# PROB ADMISSION FOR GRE 2 SD ABOVE AVERAGE
# ADJUSTED FOR MOST PRESTIGIOUS UNDERGRAD SCHOOL

ci(fit,C=2,baseline=TRUE,C.expit=c(1,0,0,0)) 


### USER-SUPPLIED INITIAL VALUES

fit2 <- lexpit(admit~I(scale(gpa)),admit~factor(rank),grad,
			par.init=list(linear=0,expit=runif(4)))

fit2

### IF FIT WITH ADAPTIVE BARRIER METHOD
### STANDARD ERROR MIGHT BE INCORRECT WHEN CONSTRAINTS ARE ACTIVE

fit2 <- lexpit(admit~I(scale(gpa)),admit~factor(rank),grad,augmented=FALSE)

fit2

Run the code above in your browser using DataLab