Announcement

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

  • #16
    You can use either summarize or mean, but just define the p values matrix for one set of results and not the other.

    Code:
    sysuse auto, clear
    estimates clear
    eststo v1: mean weight price if foreign
    eststo v2: mean weight price if !foreign
    mat pval= r(table)["pvalue", 1...]
    estadd mat pval=pval
    esttab v*, cells(b(fmt(3) star pval(pval)) se(par fmt(2))) ///
        mlab(Domestic Foreign, lhs(Variables)) collab(none) nonumb ///
        addnote("Standard errors in parentheses." "Significance stars only shown for foreign cars.")
    Res.:

    Code:
    . esttab v*, cells(b(fmt(3) star pval(pval)) se(par fmt(2))) ///
    >     mlab(Domestic Foreign, lhs(Variables)) collab(none) nonumb ///
    >     addnote("Standard errors in parentheses." "Significance stars only shown for foreign cars.")
    
    --------------------------------------------
    Variables        Domestic         Foreign   
    --------------------------------------------
    weight           2315.909        3317.115***
                      (92.32)         (96.43)   
    price            6384.682        6072.423***
                     (558.99)        (429.49)   
    --------------------------------------------
    N                      22              52   
    --------------------------------------------
    Standard errors in parentheses.
    Significance stars only shown for foreign cars.
    Last edited by Andrew Musau; 04 Aug 2023, 05:05.

    Comment


    • #17
      Once again, learned a lot from you. It worked perfectly!
      You inspired me to learn more about matrix on STATA.
      Thank you, Andrew.

      Kind regards.

      Comment

      Working...
      X