Announcement

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

  • variable means and p-values for treatment and control group

    Hi everyone,

    for my assignment I need to test my regression discontinuity sample for balance. In order to do so I want to compare various means of baseline characteristics for treatment and control group.
    I managed to output the means and compare them in a table via outreg2 but now I struggle to get the p-value to check for significant differences.

    My code so far was:

    global variables_baseline "my variables"
    estpost sum $variables_baseline
    outreg2 using baseline if survey==2016 & in_bw==1 & treatment==0, sum keep($variables_baseline) stats(mean) ct(Control Group) title (Characteristics at baseline) label dec(3) replace
    outreg2 using baseline if survey==2016 & in_bw==1 & treatment==1, sum keep($variables_baseline) stats(mean) ct(Treatment Group) label dec(3) append word

    Is it possible to get the needed p-values for significant differences in the third column?

    Thanks a lot in advance!

  • #2
    Imbens and Wooldridge (among others) do not recommend t-test since it depends on sample size (so trivially small differences may be significant in large samples). Standardized Differences is often recommended. It is akin to a t-test but excludes sample size (large is >0.25, though some say 0.10 in epidemiology). The command -covbal- does the trick. I think you can "ssc install covbal".

    If you insist, then use ttest and scroll through your X.

    Code:
    foreach var in $variables_baseline {
        qui ttest `var' if survey==2016 & in_bw==1, by(treatment)
        di "`var'" _col(20) "t = " %7.3f r(t) _col(40) "pr = " %5.3f r(p)
    }

    Comment


    • #3
      Worked!! Thank you very much!

      Comment

      Working...
      X