## compute MLE parameters of normal random sample
x <- rnorm(100)
loglik <- function(theta) {
dnorm(x, mean=theta[1], sd=theta[2], log=TRUE)
}
m <- maxLik(loglik, start=c(mu=0, sd=1))
summary(m)
confint(m)
confint(m, "mu", level=0.1)
Run the code above in your browser using DataLab