Announcement

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

  • Exporting wild bootstrap pvalues for many regressions

    Dear Statalisters,

    I have 6 dependent variables (y1,...y6) and 10 independent variables (x1,...x10). I need to run each dependent variable on each independent variable separately. I want to export wild bootstrap pvalues for all 60 regesssions. Something like this

    reg y x, cluster(clusterid)
    boottest x, cluster(clusterid) seed(12345)
    local pval = r(p)

    I want to find a way to export all wild bootstrap pvalues of those 60 regression to one or few excel files. Could you give any suggestion on how to this?
    Thanks
    Last edited by Daisy Dang; 16 Sep 2024, 00:31.

  • #2
    boottest is from SSC (FAQ Advice #12). Do not make a habit of setting the seed when bootstrapping. This is typically done to reproduce results in illustrations of the technique.

    Code:
    frame change default
    cap frame drop results
    frame create results str38(yvar xvar) double pvalue
    foreach yvar in y1 ... y6{
        foreach xvar in x1 ... x10{ 
             reg `yvar' `xvar', cluster(clusterid)
             boottest `xvar', cluster(clusterid)
             frame post results ("`yvar'") ("`xvar'") (`r(p)')
        }
    }
    frame change results
    browse
    export excel using myfile, firstrow(var) replace

    Comment


    • #3
      That works perfectly. Thanks alot, Andrew.

      Comment

      Working...
      X