| fitLogistic {bigstep} | R Documentation |
Fit the logistic regression model and calculate the log-likelihood.
fitLogistic(X, y)
X |
a numeric matrix. |
y |
a numeric vector. |
A number, the log-likelihood.
set.seed(1) n <- 100 M <- 10 X <- matrix(rnorm(M*n), ncol=M) mu <- X[, 2] - X[, 3] + X[, 6] - X[, 10] p <- 1/(1 + exp(-mu)) y <- rbinom(n, 1, p) fitLogistic(X, y)