Displaying 1 result from an estimated 1 matches for "mlelo".
Did you mean:
melo
2006 Jan 29
1
Logit regression using MLE
...ogit regression. The final command invokes ‘optim’ to obtain the
parameter estimates. The code works OK but I want to use the ‘mle’
function in the ‘stats4’ package instead of directly calling ‘optim’.
Can someone please figure out the command to do this?
Thank you in advance.
Martin
# mlelo.r - maximum likelihood estimation for logit regression
# log-likelihood function (returns negative to minimise)
log.lo.like <- function(beta,Y,X) {
Fbetax <- 1/(1+exp(-beta%*%t(X)))
loglbeta <- -log(prod(Fbetax^Y*(1-Fbetax)^(1-Y)))
}
# data
Y <- c(0,0,1,0,0,1,1,0,0,0...