logitModel: Alternative Logistic Regression Implementation

Description Usage Arguments Value Examples

Description

logitModel computes a logistic regression for a binary response variable via newtonRaphson estimation method.

Usage

1
logitModel(formula, data, precision = 1e-10, iterMax = 25)

Arguments

formula

an object of class "formula".

data

an optional data frame or coercible to one. If empty, the variables are taken from the Global Environment.

precision

degree of precision of optimisation algorithm.

iterMax

maximum number of iterations of optimisation algorithm.

Value

logitModel returns an object of class logitModel, which includes the coefficients, fitted vlaues, variance-covariance matrix, residuals, degree of freedom, loglikelihood value and deviance (these last three values also from Null model), and AIC. A few extra extra inforamtion such as the formula, the function call, the response variable and the design matrix, as well as the weight matrix and the number of iterations needed for convergence.

Examples

1
2
3
4
5
6
set.seed(42)
X1 <- rnorm(100);    X2 <- rnorm(100);
points <- 2 * X1 - 3 * X2
y <- rbinom(100, 1, exp(points) / (1 + exp(points)))
X <- cbind(b1 = 1, b2 = X1, b3 = X2)
fit <- logitModel(y ~ X1 + X2)

mr-avila/logitModel documentation built on May 13, 2019, 5:25 p.m.