lgtreg
Logistic regression
lgtreg(x, y, tol = 1e-10, maxit = 50)Maximum likelihood for a 0/1 outcome and a logit link, by Newton’s
method on the design with centred columns, the method glm() uses with
family = binomial() when the columns are not collinear. Standard
errors come from the inverse Fisher information.
Parameters
Section titled “Parameters”xThe predictors: a numeric matrix with more rows than columns plus one, with no missing values; an intercept is always added.
yThe outcome: 0 or 1, one per row of
x, both present.tolNewton steps stop when none moves a coefficient by more than
tol (1 + |coefficient|): one positive number.maxitThe most Newton steps: one whole number.
Returns
Section titled “Returns”A list: coef and se, named numeric vectors with the
intercept first, and dev, the residual deviance.
References
Section titled “References”McCullagh, P. and Nelder, J. A. (1989). Generalized Linear Models (2nd ed.). Chapman and Hall. doi:10.1007/978-1-4899-3242-6
Examples
Section titled “Examples”set.seed(1)x <- matrix(rnorm(300 * 2), 300)y <- rbinom(300, 1, plogis(0.5 + x[, 1] - x[, 2]))lgtreg(x, y)$coefGenerated from the R help page: lgtreg in the R reference.