pxlogistic | R Documentation |
This is an implementation of a parameter-expanded ECME algorithm for estimating the regression coefficients in a logistic regression model.
pxlogistic(par, X, y, n.trials=rep(1, length(y)), lambda=NULL, control=list())
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*. |
A list with the following components
coef |
The vector of regression coefficient estimates. |
iter |
The number of PX-ECME iterations required to reach convergence. |
Zhongzhe Ouyang and Nicholas Henderson
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.