Learn R Programming

blm (version 1.2)

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,adaptive=FALSE,...)

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.
adaptive
logical, whether the optimization method should use an adpative barrier.
...
Additional argument to control.outer of constrOptim.nl

Value

  • Returns an object of class lexpit.

Details

lexpit like blm is a wrapper for constrOptim.nl which performs constrained optimization for nonlinear functions and linear/nonlinear inequality constraints. The distinction with blm is that a confounder-adjusted baseline risk is modeled through the expit term.

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 insructions 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 containins 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. tol is the criterion for zero, so any evaluated contraints 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.

See Also

blm-class,blm,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~gpa,admit~factor(rank),grad,par.init=list(linear=0,expit=runif(4)))

fit2

Run the code above in your browser using DataLab