Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • "option neq() not allowed" with estimates command

    I estimated a 9 equations mvprobit model. Because this get so many hours to finished, I usually save the results for the pos estimation analysis.

    Suppose the following code:

    drop _all
    estimates clear
    cd C:\POF\engel
    use http://www.stata-press.com/data/r7/school.dta, clear

    if 1 {
    mvprobit (private = years logptax loginc) (vote = years logptax loginc)
    estimates save est_mvprobit, replace
    estimates store est_mvprobit
    }
    else {
    estimates use est_mvprobit
    estimates
    }
    That's all right. And when I change the command "if 1" to "if 0" the estimated model is recovered. But if Stata is restarted and the same code is executed with "if 0" option I get:

    . drop _all
    . estimates clear
    . cd C:\POF\engel
    C:\POF\engel
    . use http://www.stata-press.com/data/r7/school.dta, clear
    .
    . if 0 {
    . mvprobit (private = years logptax loginc) (vote = years logptax loginc)
    . estimates save est_mvprobit, replace
    . estimates store est_mvprobit
    . }
    . else {
    . estimates use est_mvprobit
    . estimates
    -------------------------------------------------------------------------------------------------------
    active results
    -------------------------------------------------------------------------------------------------------
    option neq() not allowed
    r(198);
    . }
    r(198);
    end of do-file
    r(198);
    Does the same occur in your system? I use Stata 17 and Windows system. What am I doing wrong?
    Last edited by Hermelino Souza; 29 Feb 2024, 08:08.

  • #2
    There appears to be a bug in mvprobit replay logic when you clear all global macros before replaying results, or if you start a new Stata session and use mvprobit or estimates to replay the coefficient table. The global macro S_MLE_M needs to be set to the number of dependent variables in the model for the replay logic to work properly. In your example, add a call to set this global macro before replaying the estimation results.
    Code:
    estimate use est_mvprobit
    global S_MLE_M = e(neqs)
    estimates

    Comment


    • #3
      Works perfectly. Thank you, have a nice day!

      Comment

      Working...
      X