-------------
      name:  <unnamed>
       log:  C:\Users\Mead\Documents\CGD_Files\H\Methods_Data\STATA_Pgms\MeadFiles\misc\iepowerdemo_examples.smcl
  log type:  smcl
 opened on:   4 Feb 2026, 11:18:34

.
. *       This DO file executes -iepowerdemo.ado- for several different sample sizes.
.
. *       The purpose of -iepowerdemo.ado- is to demonstrate the impact of sample size
. *       on the precision of impact estimation using a random controlled trial or RCT.
. *       For user-supplied population parameters, the program visualizes
. *       the statistical power of the impact estimation.
.
. *       -iepowerdemo.ado- draws multiple replications of a random sample from a
. *       population consisting of two groups, a "Control Group" and a "Treatment Group".
. *       The definition of "impact" is the difference between the means in the two groups.
.
.
. *       Check to see if -grc1leg2- is installed and, if not, install it
. cap which require

. if _rc==0 {
.         require grc1leg2>=2.26, install from(http://digital.cgdev.org/doc/stata/MO/Misc)
. }

.
. *       Confirm that -iepowerdemo- is on Stata's ADO path
. *       and thus available to this DO file.
. capture prog drop iepowerdemo

. which iepowerdemo
.\iepowerdemo.ado
*!      version 0.5 4Feb2026 by Mead Over for UPSE DE 292

.
. *       Set the number of replications at each sample size as a global macro
. global reps 500

.
. *       Set the random number seed so the results are replicable
. set seed 314157

.
. *       Run -iepowerdemo.ado- for several different sample sizes:
.
. *       With N1=N2=15.
. *               With the option -showrep(rep#)-, the program displays how it works
. *               for a single designated replication.
. iepowerdemo, reps($reps) n1(15) n2(15) mu1(10) sigma1(4) mu2(11) sigma2(4) showrep(5)

******************* Replication 5 *******************

Simulated data for replication 5
summarize

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
       index |         30        15.5    8.803408          1         30
         grp |         30          .5    .5085476          0          1
           y |         30    10.33764    4.345079    .585795    17.5317

ttest y , by(grp) unequal reverse

Two-sample t test with unequal variances
---------+--------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
Treatmen |      15    11.17823    .9956274    3.856048    9.042818    13.31363
 Control |      15    9.497059    1.230847    4.767049    6.857155    12.13696
---------+--------------------------------------------------------------------
Combined |      30    10.33764    .7932992    4.345079    8.715164    11.96012
---------+--------------------------------------------------------------------
    diff |            1.681167    1.583117               -1.568092    4.930425
---------+--------------------------------------------------------------------
    diff = mean(Treatmen) - mean(Control)                         t =   1.0619
H0: diff = 0                     Satterthwaite's degrees of freedom =  26.8285

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.8511         Pr(|T| > |t|) = 0.2977          Pr(T > t) = 0.1489

iepowerdemo has saved the following files to disk:
   8.2k   2/04/26 11:18  diffmeans_obs_30.gph
   9.0k   2/04/26 11:18  reject_ho_obs_30.gph
   9.4k   2/04/26 11:18  twomeans_obs_30.gph
  49.5k   2/04/26 11:18  sample_means_long_obs_30.dta
  30.9k   2/04/26 11:18  sample_means_wide_obs_30.dta

.
end of do-file

. return list

macros:
           r(gphfiles) : "diffmeans_obs_30.gph" "reject_ho_obs_30.gph" "twomeans_obs_30.gph"
          r(datafiles) : "sample_means_long_obs_30.dta" "sample_means_wide_obs_30.dta"

. displaygph `r(gphfiles)', g
type mismatch
r(109);

. return list

macros:
           r(gphfiles) : "diffmeans_obs_30.gph" "reject_ho_obs_30.gph" "twomeans_obs_30.gph"
          r(datafiles) : "sample_means_long_obs_30.dta" "sample_means_wide_obs_30.dta"

. displaygph `r(gphfiles)'
There are no memory graphs which fit the pattern: diffmeans_obs_30.gph" "reject_ho_obs_30.gph" "twomeans_obs_30.gph
Graph names are case sensitive, so check the capitalization in your pattern
Here are the graphs currently in memory:
    diffmeans_obs_30   diffmeans_stacked  reject_ho_obs_30   reject_ho_stacked  samp_dist_stacked  twomeans_obs_30

. displaygph `"`r(gphfiles)'"', g
varlist not allowed
r(101);

. displaygph `"`r(gphfiles)'"'
varlist not allowed
r(101);

. displaygph *_obs_30, g
There are no graphs in the current folder which fit the pattern: *_obs_30
Graph names are case sensitive, so check the capitalization in your pattern
Here are the graph files in the current folder, if any.
    __diffplot_ex_0.gph      __hist_withlbls.gph      kme.gph                  reject_ho_stacked.gph
    __diffplot_ex_1.gph      __hist_withlines.gph     linewrap22_better2.gph   samp_dist_stacked.gph
    __diffplot_ex_2.gph      __hist_withxlog.gph      linewrap22_hbarhlbl.gph  shr.gph
    __diffplot_ex_3.gph      diffmeans_obs_30.gph     linewrap22_vbarhlbl.gph  tmp.gph
    __diffplot_ex_4.gph      diffmeans_stacked.gph    linewrap22_vbarvlbl.gph  twomeans_obs_30.gph
    __hist_no_lbls.gph       gfd.gph                  mergedta_price.gph
    __hist_no_options.gph    klf.gph                  reject_ho_obs_30.gph

. displaygph _obs_30, g
There are no graphs in the current folder which fit the pattern: _obs_30
Graph names are case sensitive, so check the capitalization in your pattern
Here are the graph files in the current folder, if any.
    __diffplot_ex_0.gph      __hist_withlbls.gph      kme.gph                  reject_ho_stacked.gph
    __diffplot_ex_1.gph      __hist_withlines.gph     linewrap22_better2.gph   samp_dist_stacked.gph
    __diffplot_ex_2.gph      __hist_withxlog.gph      linewrap22_hbarhlbl.gph  shr.gph
    __diffplot_ex_3.gph      diffmeans_obs_30.gph     linewrap22_vbarhlbl.gph  tmp.gph
    __diffplot_ex_4.gph      diffmeans_stacked.gph    linewrap22_vbarvlbl.gph  twomeans_obs_30.gph
    __hist_no_lbls.gph       gfd.gph                  mergedta_price.gph
    __hist_no_options.gph    klf.gph                  reject_ho_obs_30.gph

. displaygph _obs_30, m
There are no memory graphs which fit the pattern: _obs_30
Graph names are case sensitive, so check the capitalization in your pattern
Here are the graphs currently in memory:
    diffmeans_obs_30   diffmeans_stacked  reject_ho_obs_30   reject_ho_stacked  samp_dist_stacked  twomeans_obs_30

. displaygph *_obs_30, m
    diffmeans_obs_30  reject_ho_obs_30  twomeans_obs_30

. displaygph *_obs_30, g
There are no graphs in the current folder which fit the pattern: *_obs_30
Graph names are case sensitive, so check the capitalization in your pattern
Here are the graph files in the current folder, if any.
    __diffplot_ex_0.gph      __hist_withlbls.gph      kme.gph                  reject_ho_stacked.gph
    __diffplot_ex_1.gph      __hist_withlines.gph     linewrap22_better2.gph   samp_dist_stacked.gph
    __diffplot_ex_2.gph      __hist_withxlog.gph      linewrap22_hbarhlbl.gph  shr.gph
    __diffplot_ex_3.gph      diffmeans_obs_30.gph     linewrap22_vbarhlbl.gph  tmp.gph
    __diffplot_ex_4.gph      diffmeans_stacked.gph    linewrap22_vbarvlbl.gph  twomeans_obs_30.gph
    __hist_no_lbls.gph       gfd.gph                  mergedta_price.gph
    __hist_no_options.gph    klf.gph                  reject_ho_obs_30.gph

. displaygph *_obs_30.gph, g
    diffmeans_obs_30.gph  reject_ho_obs_30.gph  twomeans_obs_30.gph

. lado iepowerdemo
 [view] [edit] [help] [edhlp] [-----] [-----]  iepowerdemo.ado

Click [here] for other links
To write the directory of ADO files to a text file
named -dirlist_ado.txt-, click or type ldir2txt.

. dir hist_ovrlay.pkg


file not found


. dir hist_overlay.pkg
   1.0k   2/01/26 11:07  hist_overlay.pkg

. copy hist_overlay.pkg  iepowerdemo.pkg

. lado iepowerdemo
 [view] [edit] [help] [edhlp] [-----] [edpkg]  iepowerdemo.ado

Click [here] for other links
To write the directory of ADO files to a text file
named -dirlist_ado.txt-, click or type ldir2txt.

. doedit "./iepowerdemo.pkg"

. viewsource hist_overlay.ado

. doedit hist_overlay.pkg

. lado iepo
 [view] [edit] [help] [edhlp] [-----] [edpkg]  iepowerdemo.ado

Click [here] for other links
To write the directory of ADO files to a text file
named -dirlist_ado.txt-, click or type ldir2txt.

. exit, clear