#m2logL=function(Lambda){2*Lambda-20-20*log(Lambda/10)-qchisq(.95,1)} #Draw the likelihood curve m2logL=function(Lambda){2*Lambda-18-18*log(Lambda/9)-qchisq(.95,1)} Lambda=seq(2,20,by=.5) plot(Lambda,m2logL(Lambda)+qchisq(.95,1),type="l",ylab="-2logL") #Draw the reference line to identify the zeroes of the object function abline(h=qchisq(.95,1)) #From the graph, the zeroes lie in the starting intervals listed below uniroot(m2logL,interval=c(3,7))$root uniroot(m2logL,interval=c(10,18))$root