Announcement

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

  • Stata printing consecutive messages ":"

    Hello,

    I´m running code from an ado file written by me, and for a specific loop, it continuously prints ":". I should note that I have everything under quietly, with some messages having a noisily.

    At this moment, my output window already looks like this:

    Starting cycle #1 out 56.
    : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
    > : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
    > : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
    > : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
    > : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
    > : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
    > : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
    > : : : : : 10% of cycles completed.
    The code that produces this output is the following:

    Code:
    noisily di "Estimating by sector regressions: A total of `total_cycles' cycles will be attempted."
    
                    local i = 1
                    
                    foreach sector of local sector_vars2 {
                        levelsof `sector' if `sector' ~= 99, local(level)    
                        foreach asd1 in `var1b' {
                            foreach asd2 of local var2 {
                                foreach asd6 of local var6 {
                                    
                                    if `i' == 1 {
                                        noisily di "Starting cycle #`i' out `total_cycles'."
                                    }
                                    
                                    foreach yy of numlist 1/9 {
                                        if `i' == `yy'*`tenths' {
                                            noisily di "`yy'0% of cycles completed."
                                        }
                                    }
    
                                    if `i' == `total_cycles' {
                                        noisily di "Starting the last cycle."
                                    }
                                    
                                    foreach asd7 of local level {
                                    if "`asd6'" == "weighted" {
                                        local pw [pw = `weight_var']
                                                            }
                                                            
                                    if "`asd6'" == "unweighted" {
                                        local pw
                                    }
                                    
                                    local t = `t' + 1
                                    cap reg `asd1' i.`asd2' `controlistict' if `sector' == `asd7', robust
                                        if _rc == 0 {
                                            local si = 1
                                            
                                            outreg2 using  "$outputdir/output_to_send/regression_results/productivity_by_`sector'_`asd2'_`asd6'.xml", ///
                                            replace excel nocons  e(df_m r2_a) ctitle(Model `si'- `asd1') label
                                            
                                            local si = `si' + 1
                                            local k = `k' + 1
                                        }    
                                    
                                    local t = `t' + 1
                                    cap reg `asd1' i.`asd2' i.`asd2'#b1.size_class `controlistict' if `sector' == `asd7', robust
                                        if _rc == 0 {
                                    
                                            outreg2 using  "$outputdir/output_to_send/regression_results/productivity_by_`sector'_`asd2'_`asd6'.xml", ///
                                             excel nocons  e(df_m r2_a)  ctitle(Model `si'- `asd1') label
                                            
                                            local si = `si' + 1
                                            local k = `k' + 1
                                        }
                                    
                                        forvalues b = 1/`ntuples' {
                                            local t = `t' + 1
    
                                            cap reg `asd1' i.`asd2'  `controlistict' `tuple`b'' if `sector' == `asd7', robust
                                                if _rc == 0 {
                    
                                                    outreg2 using  "$outputdir/output_to_send/regression_results/productivity_by_`sector'_`asd2'_`asd6'.xml", ///
                                                    excel nocons  e(df_m r2_a)  ctitle(Model`si'- `asd1') label
                                                    
                                                    local si = `si' + 1
                                                    local k = `k' + 1
                                                }
                                                
                                        }
                                    
                                    }
                                    
                                    local i = `i' + 1
                                }
                            }
                        }
                    }
    Using Stata 18. Any insights on what could be printing this message and why?

    Thank you in advance!
    Best,
    Hélder

  • #2
    If you're not asking for that does it come from outreg2 (from SSC)?

    Comment


    • #3
      Hi Nick,

      Indeed, commenting out the outreg2 command seems to avoid this problem. Still, I´m unable to understand why using the command would print that message, and it is even stranger as everything is under quietly.

      Best,
      Hélder

      Comment


      • #4
        I don't know either. I think I once used outreg2 several years back but I am not minded to rummage in its innards.

        Comment


        • #5
          a possibility is lines 80-90 in the outreg2.ado file.

          Comment

          Working...
          X