Announcement

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

  • Testing equlity of the coeffcients across two samples

    I’m estimating two Poisson pseudo-maximum-likelihood models with high-dimensional fixed effects using ppmlhdfe in Stata. Each model covers a different subset of my data (e.g. purchases of oranges vs. tangerines), but both share the same treatment indicator (postreatment) and the same set of FE and clustering variables.

    My goal is to test whether the effect of postreatment is statistically different between the two models
    Code:
    ppmlhdfe transactions_orange  postreatment, a(monthlydate country) vce(cluster country)
    est sto m1
    
    ppmlhdfe transactions_tangerine postreatment, a(monthlydate country) vce(cluster country)
    est sto m2
    I attempted to use suest to combine the two sets of estimates:

    Code:
    suest m1 m2
    test [m1_mean]postreatment = [m2_mean]postreatment
    but I get the error:

    Code:
    m1 was estimated with cluster(country).
    re-estimate without the cluster() option, and
    specify the cluster() option with suest.
    r(322);
    But it still does not work when I do what Stata recommends

    Code:
    m1 was estimated with a nonstandard vce (robust)
    This is my solution, is that right?
    Code:
    program define diffp, rclass
        quietly {
            ppmlhdfe transactions_orange postreatment,  a(monthlydate country) ///
                vce(cluster country)
            local b1 = _b[postreatment]
    
            ppmlhdfe transactions_tangerine postreatment, a(monthlydate country) ///
                vce(cluster country)
            local b2 = _b[postreatment]
        }
        return scalar diff = `b1' - `b2'
    end
    
    bootstrap r(diff), reps(500) seed(2021): diffp
    Another option is just stacking the two samples and testing the interaction effect, but not sure if it is okay for poisson. Thank you for all the help

    Last edited by Isabella Trombini; 22 Jun 2025, 06:53.

  • #2
    You did not properly follow Stata's suggestion about how to use -suest-. You eliminated -vce(cluster)- all right, but then you put in -vce(robust)-, which -suest- also does not support. You can re-run the two regressions with "vanilla" vce (i.e., don't specify any -vce- option at all), and then you can specify -vce(cluster)- on the -suest- command itself.

    Alternatively, yes you can stack the data and use an interaction model. That works as well with Poisson regressions as with anything else.

    Comment

    Working...
    X