Announcement

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

  • error message "2bn: operator invalid" appears when running the entire do-file

    Dear Statalist-Users,

    I have a problem with Stata which only appears when running the entire code: After preparing the data I run many regressions (mainly logit and probit), storing the result of each single regression using the command ‘estimates store‘. Afterwards I combine several related regressions to export the stored results (estout-command):

    Code:
    // [Data preparation]
     
    logit programme i.sector growth ln_sales profitability past_performance_1y
    estimates store regression1
    logit programme i.sector growth ln_sales profitability past_performance_1y assets_tan sp500
    estimates store regression2
    estout regression1 regression2 using Results1.txt, cells(b(star fmt(3)) se(par fmt(2))) starlevels(* 0.1 ** 0.05 *** 0.01) stats(r2 N, fmt(3 0)) dmarker(,) replace
    drop _est_*
    estimates drop *
     
    logit programme i.sector growth ln_sales profitability past_performance_3y
    estimates store regression3
    logit programme i.sector growth ln_sales profitability past_performance_3y assets_tan sp500
    estimates store regression4
    estout regression3 regression4 using Results2.txt, cells(b(star fmt(3)) se(par fmt(2))) starlevels(* 0.1 ** 0.05 *** 0.01) stats(r2 N, fmt(3 0)) dmarker(,) replace
    drop _est_*
    estimates drop *

    When running each part separately, there is no problem with my code. If I run the entire code with dozens of estout-commands, Stata gives me the following error message for the forelast estout-command:

    Code:
    2bn: operator invalid
    r(198)
    The affected estout-command is similar to the other commands which work. Furtermore there is no problem when I restart the code at the point where Stata stopped.
    At first I thought it had something to do with too many estimates in the memory, thus I added ‘estimates drop * ‘. Furthermore I set the matsize to 1000, but it still does not work.
    I use Stata 15, in case that matters.

    Does anyone have a solution for this problem or any suggestions what I could try?

    Kind regards

    Dominik

  • #2
    Can you show the results of simply estout regression3 regression4 before the estout regression3 regression4… command that fails?

    Comment

    Working...
    X