You are not logged in. You can browse but not post. Login or Register by clicking 'Login or Register' at the top-right of this page. For more information on Statalist, see the FAQ.
Here, Y = {y1, y2, ..., y10} = {10, 9, 21, 4, 14, 11, 22, 9, 6, 4}. Using the (log-)likelihood function, how I can demonstrate the maximum likelihood estimation in STATA ?
The binomial distribution models the number of successes y out of n trials. Your y vector has entries between 4 and 22, but in the log-likelihood you specify n as 10. Clearly the data are not consistent with the model. If you change 10 to something like 25 the code will run and give the correct estimate of 0.44. You could also define a variable n to hold the binomial denominators, specify both y and n in your model statement, and use the macros $ML_y1 and $ML_y2 to refer to them when you evaluate the log-likelihood.
Comment