pxlogistic: Parameter-expanded ECME algorithm for logistic regression

View source: R/pxlogistic.R

pxlogisticR Documentation

Parameter-expanded ECME algorithm for logistic regression

Description

This is an implementation of a parameter-expanded ECME algorithm for estimating the regression coefficients in a logistic regression model.

Usage

pxlogistic(par, X, y, n.trials=rep(1, length(y)), lambda=NULL, control=list())

Arguments

par

A vector of initial parameter values.

X

The design matrix.

y

The vector of outcomes.

n.trials

The vector containing the "number of trials" for each outcome.

lambda

Magnitude of the L2 penalty if using penalized logistic regression.

control

A list of control parameters specifying any changes to default values of algorithm control parameters. Full names of control list elements must be specified, otherwise, user-specifications are ignored. See *Details*.

Value

A list with the following components

coef

The vector of regression coefficient estimates.

iter

The number of PX-ECME iterations required to reach convergence.

Author(s)

Zhongzhe Ouyang and Nicholas Henderson

Examples

n <- 500
beta.true <- c(1, 0, 0.3, -0.3)
X <- cbind(1, matrix(rnorm(n*3, mean=0), ncol=3))
phi <- X %*% beta.true
probs <- 1/(1+exp(-phi))
y <- rbinom(n, size=1, prob=probs)

beta.init <- runif(4)
logist.fit <- pxlogistic(par=beta.init, X=X, y=y) 

nchenderson/pxlogistic documentation built on Nov. 16, 2024, 8:57 a.m.