Announcement

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

  • How to add ttest for difference of means in my regression table?

    Hi statalist,

    I'm looking at heterogeneity of ITT by some observable characteristics.
    The sample code is as follows:

    Code:
    eststo: areg y treat##post if x1==1, absorb(x2) cluster(cluster)
    estadd local fe "Yes"
    estadd local control "Yes"
    estadd ysumm
    
    eststo: areg y treat##post if x1==0, absorb(x2) cluster(cluster)
    estadd local fe "Yes"
    estadd local control "Yes"
    estadd ysumm
    
    esttab est1 est2 using "....\table.tex", s(ymean N fe control, label("Y_mean" "N" "Fixed Effects" "Control variables"))se ar2 starlevels(* 0.10 ** 0.05 *** 0.01)                        ///
            title(Table)
    I also want to present the ttest for difference of means to see if the difference in DiD coefficients between the two groups is statistically significant.

    While I can manually add the ttest results, i have a lot of variables and many dimensions and it would become tedious.

    Is there any way to insert the ttest results by amending the existing code?

    Thanks in advance!

  • #2
    a t-test is a regression where the only predictor is the group - so just use -regress- if -ttest- is a problem for the program you are using (I am not familiar with that set of programs)

    Comment

    Working...
    X