Announcement

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

  • esttab - Trying to get Column Labels to work - SIMPLE (I think) - Also significance stars

    I am trying to label each of the three columns here, but I only get the table "Model 1" for all three using STATA 18.0. As well I do not see any * (stars) for significance.

    input bike car treatment
    17 1 1
    18 1 1
    17 1 1
    17 1 1
    18 1 1
    17 1 1
    3 2 0
    2 2 0
    1 2 0
    1 2 0
    end

    eststo model1: estpost tabstat bike car if (treatment == 1), stat(mean sd) columns(statistics)
    eststo model2: estpost tabstat bike car if (treatment == 0), stat(mean sd) columns(statistics)
    eststo model3: estpost tabstat bike car, stat(mean sd) columns(statistics)

    esttab model1 model2 model3, replace ///
    main(mean %9.3f star) aux(sd %9.3f) ///
    unstack noobs nonumbers star(* 0.40 ** 0.05 *** 0.01) stats(N, fmt(a) label("Number of Observations")) ///
    collabels("Model 1" "Model 2" "Model 3") varlabels()

  • #2
    One star for P < 0.40. Assuming that's not a typo, I've never seen so much generosity!

    (You're using some excellent commands I never use myself, so there should be answers nearer your point.)

    Comment


    • #3
      Those are -mlabels()- (model labels) rather than -collabels()- (column labels). No p-values are attached to your estimates, perhaps just use the mean command if you want significance stars displayed or manually add the p-values to the estimation results.

      Code:
      clear
      input bike car treatment
      17 1 1
      18 1 1
      17 1 1
      17 1 1
      18 1 1
      17 1 1
      3 2 0
      2 2 0
      1 2 0
      1 2 0
      end
      
      eststo model1: estpost tabstat bike car if (treatment == 1), stat(mean sd) columns(statistics)
      eststo model2: estpost tabstat bike car if (treatment == 0), stat(mean sd) columns(statistics)
      eststo model3: estpost tabstat bike car, stat(mean sd) columns(statistics)
      
      esttab model1 model2 model3, replace ///
      main(mean %9.3f star) aux(sd %9.3f) ///
      unstack noobs nonumbers star(* 0.10 ** 0.05 *** 0.01) stats(N, fmt(a) label("Number of Observations")) ///
      mlabels("Model 1" "Model 2" "Model 3") varlabels()
      Res.:

      Code:
      . esttab model1 model2 model3, replace ///
      > main(mean %9.3f star) aux(sd %9.3f) ///
      > unstack noobs nonumbers star(* 0.10 ** 0.05 *** 0.01) stats(N, fmt(a) label("Number of Observations")) ///
      > mlabels("Model 1" "Model 2" "Model 3") varlabels()
      
      ------------------------------------------------------------
                        Model 1         Model 2         Model 3  
      ------------------------------------------------------------
      bike               17.333           1.750          11.100  
                        (0.516)         (0.957)         (8.075)  
      
      car                 1.000           2.000           1.400  
                        (0.000)         (0.000)         (0.516)  
      ------------------------------------------------------------
      Number of ~s            6               4              10  
      ------------------------------------------------------------
      mean coefficients; sd in parentheses
      * p<0.10, ** p<0.05, *** p<0.01

      Comment

      Working...
      X