Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: Maximum Likelihood

From   Joe Canner <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: RE: Maximum Likelihood
Date   Wed, 2 Apr 2014 12:27:41 +0000

Tim, I thought the same thing at first about the function names.  Apparently, these are outdated versions which are undocumented but still work.  For example,  normprob() was replaced by normal().  Perhaps  the new version solves the accuracy problem that Bill Gould warned about.

Hitomi, see my response on regarding a syntax error that may be causing your problem.

Joe Canner

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Timothy Mak
Sent: Wednesday, April 02, 2014 5:41 AM
To: [email protected]
Subject: st: RE: Maximum Likelihood


I see a number of strange codings in your codes below: 

1. I did "search normprob" and "search binorm". Apparently, Stata doesn't have these functions. I suspect this is what Stata is complaining. Perhaps you want "binormal()" and "normal()" instead??? Try typing 

help functions

to see what are acceptable Stata functions

2. Try not to use too many ^ if you can. E.g. ln(x^y) = y*ln(x). e.g. if you type, 

di ln(10^1000)

you get a missing, but if you type

di 1000 * ln(10)

that's ok. 

That's all I can spot now. 


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Hitomi Amaya
Sent: 02 April 2014 02:53
To: [email protected]
Subject: st: Maximum Likelihood


I defined the following maximum likelihood program for bivariate probit
STATA gave me an error "unknown function 1-()".
I found William Gould of Stata corp mentioning:
"Never code 1-normprob(z).  Code instead normprob(-z), which is far more
to Deborah who raised a similar question on this STATA list.

However, as you can see in my code below, I have 1-(normprob(z)^131) instead
of 1-normprob(z).
I cannot easily convert it into a form without using 1-(...).  

I read "Maximum Likelihood Estimation with Stata", but I couldn't find a
I would very much appreciate it if anyone could come up with a solution to
this problem.

There is my code (which is a modification of the code written by Antoine,
also found on the STATA list):

program define mybiprobt
args lnf theta1 theta2 theta3
tempvar TH
quietly gen double
quietly replace
if $ML_y1==0 & $ML_y2==0
quietly replace
if $ML_y1==0 & $ML_y2==1
quietly replace
if $ML_y1==1 & $ML_y2==0
quietly replace
if $ML_y1==1 & $ML_y2==1

Thank you.
Hitomi Amaya

View this message in context:
Sent from the Statalist mailing list archive at

*   For searches and help try:

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index