Announcement

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

  • Difference between quietly gen, quietly test and quietly regress?

    Hi guys, I'm trying to replicate a paper but could not understand the meaning of the following commands. I tried googling it but still, the meaning is not clear to me.

    foreach x in N_baseline {
    qui gen `x'_T1=`x' if vote==1
    qui gen `x'_T2=`x' if vote==0

    foreach k in T1 T2 {
    egen m_`k'=mean(`x'_`k')
    local m_`k' = m_`k'
    egen sd_`k'=sd(`x'_`k')
    local sd_`k'= sd_`k'
    }

    quietly reg `x' vote, r
    quietly test vote = 0
    gen p_1= r(p)
    local p_1 = p_1

  • #2
    Guest:
    see -help quietly-.
    Last edited by sladmin; 02 Oct 2020, 05:34. Reason: anonymize original poster
    Kind regards,
    Carlo
    (StataNow 19.0)

    Comment


    • #3
      Hi Carlo,
      I tried that but I was unable to understand and link it with the above commands.

      Help quietly is giving me the following statement: 'quietly suppresses all terminal output for the duration of the command. It is useful both interactively and in programs.'

      Comment


      • #4
        Here is an example.
        Code:
        . sysuse auto, clear
        (1978 Automobile Data)
        
        . generate price_0 = price if foreign==0
        (22 missing values generated)
        
        . quietly generate price_1 = price if foreign==1
        
        . count if missing(price_1)
          52
        
        .
        As you see, the generate command without quietly in front of it generated a message with the number of missing values created, while the generate command with quietly in front of it had the message suppressed, even though the count command shows that missing values were also created.

        Other than making the command run without showing any output, the quietly prefix does not affect the functioning of the command and you will find your output easier to understand and learn from if you remove the quietly prefix wherever it occurs.

        Comment


        • #5
          So, quietly just prevents STATA from displaying any output?

          Comment


          • #6
            Hamman:
            yes.
            Notwithstanding, results can be retrieved with some Stata-ish language familiarity:
            Code:
            . sysuse auto.dta
            (1978 Automobile Data)
            
            . sum pric
            
                Variable |        Obs        Mean    Std. Dev.       Min        Max
            -------------+---------------------------------------------------------
                   price |         74    6165.257    2949.496       3291      15906
            
            . quietly sum price
            
            . di r(mean)
            6165.2568
            
            .
            Kind regards,
            Carlo
            (StataNow 19.0)

            Comment


            • #7
              Error output is not suppressed.

              Comment

              Working...
              X