stata-pretrends
stata-pretrends copied to clipboard
Multivariate Normal Plugin
Plugin to call Alan Genz's Fortran code
@jonathandroth I've implemented this in Unix. It seems the speed gains come at the cost of numerical precision. It's probably the correct trade-off, given how insanely slow this is at higher dimensions.
I'll merge later on. I assume I'll need a bit of time to debug the OSX compilation given the extra step of calling Fortran code.
@jonathandroth I got the Linux and windows working, and it compiles on x86_64 on a Mac. Can you test that out? TBD if I'll get the arm64 (silicon) to compile
Just to make sure, you want me to uninstall the package, then net install from your github and try running the example?
On Sat, Apr 13, 2024 at 11:12 AM Mauricio Caceres Bravo < @.***> wrote:
@jonathandroth https://github.com/jonathandroth I got the Linux and windows working, and it compiles on x86_64 on a Mac. Can you test that out? TBD if I'll get the arm64 (silicon) to compile
— Reply to this email directly, view it on GitHub https://github.com/mcaceresb/stata-pretrends/pull/6#issuecomment-2053673436, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE6EXFF4D4ABJVJMJFUJSSLY5FDMHAVCNFSM6AAAAABGFEMCLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJTGY3TGNBTGY . You are receiving this because you were mentioned.Message ID: @.***>
@jonathandroth
- If you have Intel then yes, and from this branch.
- If you have Silicon then you'll have to compile first. You can run
do src/installfrom this wording directory from inside Stata. LMK if it works or not (e.g. you may need to install the compiler from xcode).
I tried on Apple silicon but there appears to be a problem with the installation. Below is my log:
name: <unnamed>
log: /Users/jonathanroth/Library/CloudStorage/Dropbox/stata-pretrends-mauricio/stata-pretrends/ap
ple-silicon.log log type: text opened on: 16 Apr 2024, 18:10:14
. do src/install
. cap noi ado uninstall pretrends package not found
. cap noi net uninstall pretrends package not found
. mata: mata clear
. mata: mata set matastrict on
. mata: mata set mataoptimize on
. cap mkdir src
. cap mkdir src/build
. shell make all
rm -f src/build/pretrends_mvnorm_macosxarm64.plugin src/plugin/mvtdstpack.o gfortran -c src/plugin/mvtdstpack.f -o src/plugin/mvtdstpack.o -bundle -O3 -arch arm64 -std=legacy make: gfortran: No such file or directory make: *** [src/plugin/mvtdstpack.o] Error 1
. cap noi erase src/build/lpretrends.mlib
. qui {
. mata: mata mlib create lpretrends, dir("src/build") replace (file src/build/lpretrends.mlib not found) (file src/build/lpretrends.mlib created)
. mata: mata mlib add lpretrends PreTrends*(), dir("src/build") complete (15 functions added)
. net install pretrends, from(`c(pwd)') replace checking pretrends consistency and verifying not already installed... installing into /Users/jonathanroth/Library/Application Support/Stata/ado/plus/... installation complete.
. * f src/build/pretrends_mvnorm_macosx.plugin . * f src/build/pretrends_mvnorm_macosxarm64.plugin . end of do-file
. use "https://media.githubusercontent.com/media/mcaceresb/stata-pretrends/main/data/workfile_AEJ.dta", c
lear
. reghdfe l_poor_reg_rate Lead_D4_plus Lead_D3 Lead_D2 D0 Lag_D1 Lag_D2 Lag_D3_plus, absorb(v_id year) cl
uster(v_id) dof(none) (MWFE estimator converged in 5 iterations)
HDFE Linear regression Number of obs = 2,654 Absorbing 2 HDFE groups F( 7, 254) = 1.41 Statistics robust to heteroskedasticity Prob > F = 0.2021 R-squared = 0.6527 Adj R-squared = 0.6130 Within R-sq. = 0.0056 Number of clusters (v_id) = 255 Root MSE = 0.5659
(Std. err. adjusted for 255 clusters in v_id)
| Robust
l_poor_reg~e | Coefficient std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- Lead_D4_plus | .0667032 .0943746 0.71 0.480 -.1191533 .2525596 Lead_D3 | -.0077018 .0770514 -0.10 0.920 -.1594428 .1440392 Lead_D2 | -.0307691 .0551237 -0.56 0.577 -.1393268 .0777887 D0 | .0840307 .0626478 1.34 0.181 -.0393445 .2074059 Lag_D1 | .2424418 .0898103 2.70 0.007 .0655741 .4193096 Lag_D2 | .219879 .0887783 2.48 0.014 .0450438 .3947142 Lag_D3_plus | .1910925 .0989365 1.93 0.055 -.0037478 .3859329 _cons | 1.478639 .0811732 18.22 0.000 1.31878 1.638497
Absorbed degrees of freedom: -----------------------------------------------------+ Absorbed FE | Categories - Redundant = Num. Coefs | -------------+---------------------------------------| v_id | 255 0 255 | year | 12 1 11 ?| -----------------------------------------------------+ ? = number of redundant parameters may be higher
. pretrends power 0.5, pre(1/3) post(4/7) warning: option b() detected without option vcov() WARNING: Unable to load mvnormalcv() plugin; falling back on mata. Execution may be excessively slow. If it takes more a few minutes we recommend using the R package. Slope for 50% power = .0520259
. log cl
name:
ple-silicon.log log type: text closed on: 16 Apr 2024, 18:10:41
@jonathandroth Can you install gcc (to get gfortran) and clang, then try again? If they're too cumbersome to install lmk.
I installed both but I'm getting the same error as before:
make: gfortran: No such file or directory make: *** [src/plugin/mvtdstpack.o] Error 1
However, if I go to the terminal and do
which gfortran
I get
/opt/homebrew/bin/gfortran
On Tue, Apr 16, 2024 at 7:17 PM Mauricio Caceres Bravo < @.***> wrote:
@jonathandroth https://github.com/jonathandroth Can you install gcc (to get gfortran) and clang, then try again? If they're too cumbersome to install lmk.
— Reply to this email directly, view it on GitHub https://github.com/mcaceresb/stata-pretrends/pull/6#issuecomment-2060057411, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE6EXFAZDXECFH7X6K5JRKLY5WWOTAVCNFSM6AAAAABGFEMCLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRQGA2TONBRGE . You are receiving this because you were mentioned.Message ID: @.***>
@jonathandroth Are you running these from Stata? If so maybe there's an issue with the shell... Can you try make all from the repo root on a terminal and see if you get the same error?
If yes I guess I'll have to figure out another way to debug. If it compiles can you delete L8 of src/install.do then run it to reinstall?
I ran make all from the terminal and did not get the same Fortran error. It appears to have run though, although it did give the following warnings:
Warning: Rank mismatch in argument 'abserr' at (1) (scalar and rank-1)
clang -Wall -O3 -bundle -DSYSTEM=APPLEMAC -static-libgfortran -o src/build/pretrends_mvnorm_macosxarm64.plugin -arch arm64 src/plugin/mvtdstpack.o src/plugin/pretrends_mvnorm.c src/plugin/stplugin.c
clang: *warning: *argument unused during compilation: '-static-libgfortran' [-Wunused-command-line-argument]
ld: warning: object file (src/plugin/mvtdstpack.o) was built for newer macOS version (14.0) than being linked (12.3)
ld: warning: could not create compact unwind for mvkrsv: registers 27 and 28 not saved contiguously in frame
ld: warning: could not create compact unwind for mvkbrv: stack size is too large for frameless function
ld: warning: could not create compact unwind for mvbvtl: registers 78 and 79 not saved contiguously in frame
ld: warning: could not create compact unwind for mvbvu: registers 78 and 79 not saved contiguously in frame
ld: warning: could not create compact unwind for mvbvn: registers 21 and 22 not saved contiguously in frame
ld: warning: could not create compact unwind for mvbvt: registers 21 and 22 not saved contiguously in frame
ld: warning: could not create compact unwind for mvspcl: registers 72 and 73 not saved contiguously in frame
ld: warning: could not create compact unwind for mvswap: register 20 saved somewhere other than in frame
ld: warning: could not create compact unwind for mvsort: registers 78 and 79 not saved contiguously in frame
ld: warning: could not create compact unwind for mvlims: registers 74 and 75 not saved contiguously in frame
ld: warning: could not create compact unwind for mvchnc: registers 76 and 77 not saved contiguously in frame
ld: warning: could not create compact unwind for mvphnv: registers 72 and 73 not saved contiguously in frame
ld: warning: could not create compact unwind for mvvlsb: registers 76 and 77 not saved contiguously in frame
ld: warning: could not create compact unwind for mvchnv: registers 74 and 75 not saved contiguously in frame
ld: warning: could not create compact unwind for master.0.mvsubr.isra.0: register 73 saved somewhere other than in frame
ld: warning: could not create compact unwind for mvtdst: registers 21 and 22 not saved contiguously in frame
ld: warning: could not create compact unwind for mvbvtc: registers 72 and 73 not saved contiguously in frame
I then deleted line 8 as you suggested, and reran src/install from Stata. However, I still get:
[image: image.png]
If you'd like to come play with my Macstudio, LMK
On Wed, Apr 17, 2024 at 3:39 PM Mauricio Caceres Bravo < @.***> wrote:
@jonathandroth https://github.com/jonathandroth Are you running these from Stata? If so maybe there's an issue with the shell... Can you try make all from the repo root on a terminal and see if you get the same error?
If yes I guess I'll have to figure out another way to debug. If it compiles can you delete L8 of src/install.do then run it to reinstall?
— Reply to this email directly, view it on GitHub https://github.com/mcaceresb/stata-pretrends/pull/6#issuecomment-2062082996, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE6EXFDVIWA67FVQP7NE2IDY53FWZAVCNFSM6AAAAABGFEMCLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRSGA4DEOJZGY . You are receiving this because you were mentioned.Message ID: @.***>
Sorry, the image didn't come through when responding via email
@jonathandroth Can you run test/unit-tests.do and LMK if you get any errors? I'll merge after that.
EDIT: From this branch.
I am getting the following error:
Full log below in case helpful:
do test/unit-tests.do
. set seed 1729
. version 15.1
. qui do test/unit-tests-basic.do
. qui do test/unit-tests-mvnorm.do
. * qui do src/ado/pretrends.ado . * qui do src/mata/pretrends.mata . . capture program drop main
. program main
-
unit_test basic_failures , noi -
unit_test basic_checks , noi -
unit_test mvnorm_checks , noi - end
. . capture program drop unit_test
. program unit_test
-
syntax namelist(min=1 max=1), [NOIsily tab(int 4) *] -
cap `noisily' `namelist', `options' -
if ( _rc ) { -
di as error _col(`=`tab'+1') `"test(failed): `namelist', `options'"' -
exit _rc -
} -
else di as txt _col(`=`tab'+1') `"test(passed): `namelist', `options'"' - end
. . main test(passed): basic_failures, slope -5 slope -4.9 slope -4.8 slope -4.7 slope -4.6 slope -4.5 slope -4.4 slope -4.3 slope -4.2 slope -4.1 slope -4 slope -3.9 slope -3.8 slope -3.7 slope -3.6 slope -3.5 slope -3.4 slope -3.3 slope -3.2 slope -3.1 slope -3 slope -2.9 slope -2.8 slope -2.7 slope -2.6 slope -2.5 slope -2.4 slope -2.3 slope -2.2 slope -2.1 slope -2 slope -1.9 slope -1.8 slope -1.7 slope -1.6 slope -1.5 slope -1.4 slope -1.3 slope -1.2 slope -1.1 slope -1 slope -.9 slope -.8 slope -.7 slope -.6 slope -.5 slope -.4 slope -.3 slope -.2 slope -.1 slope 0 slope .1 slope .2 slope .3 slope .4 slope .5 slope .6 slope .7 slope .8 slope .9 slope 1 slope 1.1 slope 1.2 slope 1.3 slope 1.4 slope 1.5 slope 1.6 slope 1.7 slope 1.8 slope 1.9 slope 2 slope 2.1 slope 2.2 slope 2.3 slope 2.4 slope 2.5 slope 2.6 slope 2.7 slope 2.8 slope 2.9 slope 3 slope 3.1 slope 3.2 slope 3.3 slope 3.4 slope 3.5 slope 3.6 slope 3.7 slope 3.8 slope 3.9 slope 4 slope 4.1 slope 4.2 slope 4.3 slope 4.4 slope 4.5 slope 4.6 slope 4.7 slope 4.8 slope 4.9 slope 5 base power 0.200 | est power 0.200 | est slope 1 .02259 | est slope 2 .02263 base power 0.210 | est power 0.210 | est slope 1 .02403 | est slope 2 .02403 base power 0.220 | est power 0.220 | est slope 1 .02539 | est slope 2 .02539 base power 0.230 | est power 0.230 | est slope 1 .02659 | est slope 2 .02659 base power 0.240 | est power 0.240 | est slope 1 .02784 | est slope 2 .02787 base power 0.250 | est power 0.250 | est slope 1 .02899 | est slope 2 .02899 base power 0.260 | est power 0.260 | est slope 1 .03016 | est slope 2 .03016 base power 0.270 | est power 0.270 | est slope 1 .03128 | est slope 2 .03127 base power 0.280 | est power 0.280 | est slope 1 .0324 | est slope 2 .0324 base power 0.290 | est power 0.290 | est slope 1 .0334 | est slope 2 .0334 base power 0.300 | est power 0.300 | est slope 1 .0344 | est slope 2 .0344 base power 0.310 | est power 0.310 | est slope 1 .03543 | est slope 2 .0354 base power 0.320 | est power 0.320 | est slope 1 .03636 | est slope 2 .03636 base power 0.330 | est power 0.330 | est slope 1 .03736 | est slope 2 .03736 base power 0.340 | est power 0.340 | est slope 1 .03832 | est slope 2 .03832 base power 0.350 | est power 0.350 | est slope 1 .03924 | est slope 2 .03923 base power 0.360 | est power 0.360 | est slope 1 .04016 | est slope 2 .04016 base power 0.370 | est power 0.370 | est slope 1 .04105 | est slope 2 .04105 base power 0.380 | est power 0.380 | est slope 1 .04198 | est slope 2 .04189 base power 0.390 | est power 0.390 | est slope 1 .04283 | est slope 2 .04283 base power 0.400 | est power 0.400 | est slope 1 .04378 | est slope 2 .04359 base power 0.410 | est power 0.410 | est slope 1 .04454 | est slope 2 .04455 base power 0.420 | est power 0.420 | est slope 1 .0454 | est slope 2 .04541 base power 0.430 | est power 0.430 | est slope 1 .04625 | est slope 2 .04617 base power 0.440 | est power 0.440 | est slope 1 .04705 | est slope 2 .04705 base power 0.450 | est power 0.450 | est slope 1 .04794 | est slope 2 .04829 base power 0.460 | est power 0.460 | est slope 1 .04877 | est slope 2 .04877 base power 0.470 | est power 0.470 | est slope 1 .0496 | est slope 2 .0496 base power 0.480 | est power 0.480 | est slope 1 .05046 | est slope 2 .05046 base power 0.490 | est power 0.490 | est slope 1 .05143 | est slope 2 .05143 base power 0.500 | est power 0.500 | est slope 1 .05203 | est slope 2 .05203 base power 0.510 | est power 0.510 | est slope 1 .0529 | est slope 2 .05288 base power 0.520 | est power 0.520 | est slope 1 .0537 | est slope 2 .05372 base power 0.530 | est power 0.530 | est slope 1 .05454 | est slope 2 .05453 base power 0.540 | est power 0.540 | est slope 1 .05537 | est slope 2 .05537 base power 0.550 | est power 0.550 | est slope 1 .05615 | est slope 2 .05617 base power 0.560 | est power 0.560 | est slope 1 .05699 | est slope 2 .05699 base power 0.570 | est power 0.570 | est slope 1 .05782 | est slope 2 .0578 base power 0.580 | est power 0.580 | est slope 1 .05863 | est slope 2 .05865 base power 0.590 | est power 0.590 | est slope 1 .05946 | est slope 2 .05948 base power 0.600 | est power 0.600 | est slope 1 .06031 | est slope 2 .06031 base power 0.610 | est power 0.610 | est slope 1 .06113 | est slope 2 .06113 base power 0.620 | est power 0.620 | est slope 1 .062 | est slope 2 .062 base power 0.630 | est power 0.630 | est slope 1 .06284 | est slope 2 .06284 base power 0.640 | est power 0.640 | est slope 1 .06373 | est slope 2 .06373 base power 0.650 | est power 0.650 | est slope 1 .06454 | est slope 2 .06454 base power 0.660 | est power 0.660 | est slope 1 .06542 | est slope 2 .06534 base power 0.670 | est power 0.670 | est slope 1 .06629 | est slope 2 .06629 base power 0.680 | est power 0.680 | est slope 1 .0672 | est slope 2 .0672 base power 0.690 | est power 0.690 | est slope 1 .06806 | est slope 2 .06806 base power 0.700 | est power 0.700 | est slope 1 .06902 | est slope 2 .06902 base power 0.710 | est power 0.710 | est slope 1 .06993 | est slope 2 .06994 base power 0.720 | est power 0.720 | est slope 1 .07092 | est slope 2 .07092 base power 0.730 | est power 0.730 | est slope 1 .07182 | est slope 2 .07182 base power 0.740 | est power 0.740 | est slope 1 .07272 | est slope 2 .07272 base power 0.750 | est power 0.750 | est slope 1 .07381 | est slope 2 .07381 base power 0.760 | est power 0.760 | est slope 1 .07482 | est slope 2 .07482 base power 0.770 | est power 0.770 | est slope 1 .0758 | est slope 2 .0759 base power 0.780 | est power 0.780 | est slope 1 .07693 | est slope 2 .07693 base power 0.790 | est power 0.790 | est slope 1 .07799 | est slope 2 .078 base power 0.800 | est power 0.800 | est slope 1 .0791 | est slope 2 .0791 base power 0.810 | est power 0.810 | est slope 1 .08023 | est slope 2 .08023 base power 0.820 | est power 0.820 | est slope 1 .08129 | est slope 2 .08144 base power 0.830 | est power 0.830 | est slope 1 .08272 | est slope 2 .08272 base power 0.840 | est power 0.840 | est slope 1 .08391 | est slope 2 .08391 base power 0.850 | est power 0.850 | est slope 1 .08529 | est slope 2 .08527 base power 0.860 | est power 0.860 | est slope 1 .08666 | est slope 2 .08666 base power 0.870 | est power 0.870 | est slope 1 .08829 | est slope 2 .08829 base power 0.880 | est power 0.880 | est slope 1 .08963 | est slope 2 .08963 base power 0.890 | est power 0.890 | est slope 1 .09126 | est slope 2 .09126 base power 0.900 | est power 0.900 | est slope 1 .09304 | est slope 2 .09304 base power 0.910 | est power 0.910 | est slope 1 .09486 | est slope 2 .09486 base power 0.920 | est power 0.920 | est slope 1 .09689 | est slope 2 .09689 base power 0.930 | est power 0.930 | est slope 1 .0991 | est slope 2 .0991 base power 0.940 | est power 0.940 | est slope 1 .10166 | est slope 2 .10166 base power 0.950 | est power 0.950 | est slope 1 .10437 | est slope 2 .10437 base power 0.960 | est power 0.960 | est slope 1 .10769 | est slope 2 .10769 base power 0.970 | est power 0.970 | est slope 1 .11184 | est slope 2 .11184 base power 0.980 | est power 0.980 | est slope 1 .11686 | est slope 2 .11686 base power 0.990 | est power 0.990 | est slope 1 .12553 | est slope 2 .12553 80% power, base alpha 0.005 | est slope .10866 | power 1 .801 | power 2 0.801 80% power, base alpha 0.010 | est slope .10063 | power 1 .8 | power 2 0.800 80% power, base alpha 0.015 | est slope .09576 | power 1 .801 | power 2 0.801 80% power, base alpha 0.020 | est slope .09207 | power 1 .801 | power 2 0.801 80% power, base alpha 0.025 | est slope .08894 | power 1 .799 | power 2 0.799 80% power, base alpha 0.030 | est slope .08653 | power 1 .8 | power 2 0.800 80% power, base alpha 0.035 | est slope .08435 | power 1 .8 | power 2 0.800 80% power, base alpha 0.040 | est slope .08242 | power 1 .8 | power 2 0.800 80% power, base alpha 0.045 | est slope .08071 | power 1 .8 | power 2 0.800 80% power, base alpha 0.050 | est slope .0791 | power 1 .8 | power 2 0.800 80% power, base alpha 0.055 | est slope .07767 | power 1 .8 | power 2 0.800 80% power, base alpha 0.060 | est slope .0763 | power 1 .8 | power 2 0.800 80% power, base alpha 0.065 | est slope .07511 | power 1 .801 | power 2 0.801 80% power, base alpha 0.070 | est slope .07387 | power 1 .8 | power 2 0.800 80% power, base alpha 0.075 | est slope .0727 | power 1 .8 | power 2 0.800 80% power, base alpha 0.080 | est slope .07166 | power 1 .8 | power 2 0.800 80% power, base alpha 0.085 | est slope .0705 | power 1 .799 | power 2 0.799 80% power, base alpha 0.090 | est slope .06962 | power 1 .8 | power 2 0.800 80% power, base alpha 0.095 | est slope .06871 | power 1 .8 | power 2 0.800 80% power, base alpha 0.100 | est slope .06779 | power 1 .8 | power 2 0.800 80% power, base alpha 0.105 | est slope .06688 | power 1 .8 | power 2 0.800 80% power, base alpha 0.110 | est slope .06601 | power 1 .8 | power 2 0.800 80% power, base alpha 0.115 | est slope .06523 | power 1 .8 | power 2 0.800 80% power, base alpha 0.120 | est slope .06441 | power 1 .8 | power 2 0.800 80% power, base alpha 0.125 | est slope .06362 | power 1 .8 | power 2 0.800 80% power, base alpha 0.130 | est slope .06295 | power 1 .801 | power 2 0.801 80% power, base alpha 0.135 | est slope .06221 | power 1 .801 | power 2 0.801 80% power, base alpha 0.140 | est slope .06139 | power 1 .8 | power 2 0.800 80% power, base alpha 0.145 | est slope .06071 | power 1 .8 | power 2 0.800 80% power, base alpha 0.150 | est slope .05995 | power 1 .8 | power 2 0.800 80% power, base alpha 0.155 | est slope .05933 | power 1 .8 | power 2 0.800 80% power, base alpha 0.160 | est slope .05864 | power 1 .8 | power 2 0.800 80% power, base alpha 0.165 | est slope .05802 | power 1 .8 | power 2 0.800 80% power, base alpha 0.170 | est slope .05723 | power 1 .799 | power 2 0.799 80% power, base alpha 0.175 | est slope .05669 | power 1 .8 | power 2 0.800 80% power, base alpha 0.180 | est slope .05751 | power 1 .812 | power 2 0.812 80% power, base alpha 0.185 | est slope .05541 | power 1 .8 | power 2 0.800 80% power, base alpha 0.190 | est slope .05481 | power 1 .8 | power 2 0.800 80% power, base alpha 0.195 | est slope .05438 | power 1 .802 | power 2 0.802 80% power, base alpha 0.200 | est slope .05357 | power 1 .8 | power 2 0.800 80% power, base alpha 0.205 | est slope .05298 | power 1 .8 | power 2 0.800 80% power, base alpha 0.210 | est slope .05238 | power 1 .8 | power 2 0.800 80% power, base alpha 0.215 | est slope .05178 | power 1 .8 | power 2 0.800 80% power, base alpha 0.220 | est slope .05117 | power 1 .8 | power 2 0.800 80% power, base alpha 0.225 | est slope .05055 | power 1 .8 | power 2 0.800 80% power, base alpha 0.230 | est slope .05002 | power 1 .8 | power 2 0.800 80% power, base alpha 0.235 | est slope .04941 | power 1 .8 | power 2 0.800 80% power, base alpha 0.240 | est slope .04875 | power 1 .799 | power 2 0.799 80% power, base alpha 0.245 | est slope .04822 | power 1 .8 | power 2 0.800 80% power, base alpha 0.250 | est slope .04766 | power 1 .8 | power 2 0.800 80% power, base alpha 0.255 | est slope .04708 | power 1 .8 | power 2 0.800 80% power, base alpha 0.260 | est slope .04647 | power 1 .8 | power 2 0.800 80% power, base alpha 0.265 | est slope .04599 | power 1 .801 | power 2 0.801 80% power, base alpha 0.270 | est slope .04531 | power 1 .8 | power 2 0.800 80% power, base alpha 0.275 | est slope .04473 | power 1 .8 | power 2 0.800 80% power, base alpha 0.280 | est slope .0441 | power 1 .8 | power 2 0.800 80% power, base alpha 0.285 | est slope .04352 | power 1 .8 | power 2 0.800 80% power, base alpha 0.290 | est slope .04286 | power 1 .799 | power 2 0.799 80% power, base alpha 0.295 | est slope .04233 | power 1 .8 | power 2 0.800 80% power, base alpha 0.300 | est slope .04172 | power 1 .8 | power 2 0.800 80% power, base alpha 0.305 | est slope .0412 | power 1 .801 | power 2 0.801 80% power, base alpha 0.310 | est slope .0405 | power 1 .8 | power 2 0.800 80% power, base alpha 0.315 | est slope .03988 | power 1 .8 | power 2 0.800 80% power, base alpha 0.320 | est slope .03925 | power 1 .8 | power 2 0.800 80% power, base alpha 0.325 | est slope .03857 | power 1 .8 | power 2 0.800 80% power, base alpha 0.330 | est slope .03779 | power 1 .799 | power 2 0.799 80% power, base alpha 0.335 | est slope .03731 | power 1 .8 | power 2 0.800 80% power, base alpha 0.340 | est slope .03661 | power 1 .8 | power 2 0.800 80% power, base alpha 0.345 | est slope .03595 | power 1 .8 | power 2 0.800 80% power, base alpha 0.350 | est slope .03525 | power 1 .8 | power 2 0.800 80% power, base alpha 0.355 | est slope .03461 | power 1 .8 | power 2 0.800 80% power, base alpha 0.360 | est slope .03389 | power 1 .8 | power 2 0.800 80% power, base alpha 0.365 | est slope .03316 | power 1 .8 | power 2 0.800 80% power, base alpha 0.370 | est slope .03242 | power 1 .8 | power 2 0.800 80% power, base alpha 0.375 | est slope .03163 | power 1 .8 | power 2 0.800 80% power, base alpha 0.380 | est slope .03092 | power 1 .8 | power 2 0.800 80% power, base alpha 0.385 | est slope .03008 | power 1 .8 | power 2 0.800 80% power, base alpha 0.390 | est slope .02924 | power 1 .8 | power 2 0.800 80% power, base alpha 0.395 | est slope .02857 | power 1 .801 | power 2 0.801 80% power, base alpha 0.400 | est slope .02751 | power 1 .8 | power 2 0.800 Number of observations (_N) was 0, now 100. (900 observations created) warning: option b() detected without option vcov() Slope for 80% power = .170476 warning: option b() detected without option vcov() Slope for 80% power = .170476 warning: option b() detected without option vcov()
scalars: r(LR) = 3.69200221757e-20 r(Bayes) = .2460845368842435 r(Power) = .800065433648153 r(slope) = .1704757216338253
macros: r(PreTrendsResults) : "PreTrendsResults"
matrices: r(results) : 14 x 6 r(delta) : 1 x 14
| t betahat lb ub deltatrue meanAft~g
-------------+------------------------------------------------------------------ r1 | -6 5.800743 4.838816 6.76267 -.8523786 -.4317186 r2 | -5 3.970423 3.314403 4.626444 -.6819029 -.3412534 r3 | -4 3.436555 2.939535 3.933574 -.5114272 -.2505426 r4 | -3 2.288442 1.897956 2.678929 -.3409514 -.1469665 r5 | -2 1.152475 .8355832 1.469367 -.1704757 -.0435712 r6 | -1 0 0 0 0 0 r7 | 0 .0083689 -.3148921 .3316299 .1704757 .1907623 r8 | 1 -.9156951 -1.300725 -.5306651 .3409514 .3334039 r9 | 2 -2.000477 -2.464547 -1.536406 .5114272 .4706748 r10 | 3 -3.356143 -3.89576 -2.816525 .6819029 .6145395 r11 | 4 -4.075824 -4.691307 -3.460341 .8523786 .7577261 r12 | 5 -5.056917 -5.744972 -4.368862 1.022854 .9030402 r13 | 6 -5.966958 -6.744965 -5.188951 1.19333 1.045248 r14 | 7 -6.920232 -7.892136 -5.948327 1.363806 1.168329 warning: option b() detected without option vcov()
scalars: r(LR) = 8.22305473719e-24 r(Bayes) = .1336177366452207 r(Power) = .8914443562934214 r(slope) = .2
macros: r(PreTrendsResults) : "PreTrendsResults"
matrices:
r(results) : 14 x 6
r(delta) : 1 x 14
test(passed): basic_checks,
mvnorm (fortran): n = 1 in 0.000s: .867689 (eps: .)
mvnormalcv(): 3200 conformability error
PreTrends_mvnormalcv(): - function returned error
@jonathandroth I believe I figured it out; the plugin was getting unloaded for the tests. Can you try again? When you confirm the tests run I'll merge.
The tests run without issue on my Macstudio.
Do you need me to test on my Intel Mac too?
@jonathandroth If you can swing it yeah that would be great!
Hmm I'm getting an error in the unit tests on my Intel Macbook. Here is the output.
. do test/unit-tests.do
. set seed 1729
. version 15.1
. qui do test/unit-tests-basic.do
. qui do test/unit-tests-mvnorm.do
. * qui do src/ado/pretrends.ado . * qui do src/mata/pretrends.mata . . capture program drop main
. program main
-
unit_test basic_failures , noi -
unit_test basic_checks , noi -
unit_test mvnorm_checks , noi - end
. . capture program drop unit_test
. program unit_test
-
syntax namelist(min=1 max=1), [NOIsily tab(int 4) *] -
cap `noisily' `namelist', `options' -
if ( _rc ) { -
di as error _col(`=`tab'+1') `"test(failed): `namelist', `options'"' -
exit _rc -
} -
else di as txt _col(`=`tab'+1') `"test(passed): `namelist', `options'"' - end
. . main assertion is false test(failed): basic_failures, r(9);
end of do-file
@jonathandroth Can you try
local c_os_ macosxarm64
cap program drop pretrends_mvnorm_plugin
program pretrends_mvnorm_plugin, plugin using("pretrends_mvnorm_`c_os_'.plugin")
and, regardless of whether there's an error,
local c_os_ macosx86_64
cap program drop pretrends_mvnorm_plugin
program pretrends_mvnorm_plugin, plugin using("pretrends_mvnorm_`c_os_'.plugin")
? If the first one gives an error and the second one succeeds, can you re-run the tests commenting out the basic_failures line? However, if the second one gives an error you might have to help me compile the intel version as well, sorry! LMK
The first code block failed. The second block succeeded.
I then commented out the line
unit_test basic_failures , noi
in src/unit-tests.do, and re-ran the tests successfully.
@jonathandroth It might be a good idea to figure out which of these fail? But I'm good merging otherwise. Can you LMK which one gives the error when you get a chance?
ereturn clear
mata {
st_matrix("beta", PreTrendsExampleBeta())
st_matrix("sigma", PreTrendsExampleSigma())
}
cap pretrends power
assert _rc == 7
cap pretrends power 0.5
assert _rc == 198
cap pretrends power 0.5, numpre(3)
assert _rc == 198
cap pretrends power 0.5, numpre(3) b(beta)
assert _rc == 198
cap pretrends power 0.5, numpre(3) b(beta) v(ZIGMA)
assert _rc == 111
cap pretrends power 0.5, numpre(3) b(beta) v(sigma) zz
assert _rc == 198
cap pretrends power 0.5, numpre(10) b(beta) v(sigma)
assert _rc == 198
cap pretrends power 0.5, numpre(7) b(beta) v(sigma)
assert _rc == 198
cap pretrends power 0.5, pre(1) post(2/10) b(beta) v(sigma)
assert _rc == 198
cap pretrends
assert _rc == 198
cap pretrends, slope(0.2)
assert _rc == 198
cap pretrends, slope(0.2) numpre(3)
assert _rc == 198
cap pretrends, slope(0.2) numpre(3) b(beta)
assert _rc == 198
cap pretrends, slope(0.2) numpre(3) b(beta) v(ZIGMA)
assert _rc == 111
cap pretrends, slope(0.2) numpre(3) b(beta) v(sigma) zz
assert _rc == 198
cap pretrends, slope(0.2) numpre(10) b(beta) v(sigma)
assert _rc == 198
cap pretrends, slope(0.2) numpre(7) b(beta) v(sigma)
assert _rc == 198
cap pretrends, slope(0.2) pre(1) post(2/10) b(beta) v(sigma)
assert _rc == 198
Those all appear to run now...
On Tue, May 21, 2024 at 10:35 AM Mauricio Caceres Bravo < @.***> wrote:
@jonathandroth https://github.com/jonathandroth It might be a good idea to figure out which of these fail? But I'm good merging otherwise. Can you LMK which one gives the error when you get a chance?
ereturn clear mata { st_matrix("beta", PreTrendsExampleBeta()) st_matrix("sigma", PreTrendsExampleSigma()) } cap pretrends power assert _rc == 7 cap pretrends power 0.5 assert _rc == 198 cap pretrends power 0.5, numpre(3) assert _rc == 198 cap pretrends power 0.5, numpre(3) b(beta) assert _rc == 198 cap pretrends power 0.5, numpre(3) b(beta) v(ZIGMA) assert _rc == 111 cap pretrends power 0.5, numpre(3) b(beta) v(sigma) zz assert _rc == 198 cap pretrends power 0.5, numpre(10) b(beta) v(sigma) assert _rc == 198 cap pretrends power 0.5, numpre(7) b(beta) v(sigma) assert _rc == 198 cap pretrends power 0.5, pre(1) post(2/10) b(beta) v(sigma) assert _rc == 198 cap pretrends assert _rc == 198 cap pretrends, slope(0.2) assert _rc == 198 cap pretrends, slope(0.2) numpre(3) assert _rc == 198 cap pretrends, slope(0.2) numpre(3) b(beta) assert _rc == 198 cap pretrends, slope(0.2) numpre(3) b(beta) v(ZIGMA) assert _rc == 111 cap pretrends, slope(0.2) numpre(3) b(beta) v(sigma) zz assert _rc == 198 cap pretrends, slope(0.2) numpre(10) b(beta) v(sigma) assert _rc == 198 cap pretrends, slope(0.2) numpre(7) b(beta) v(sigma) assert _rc == 198 cap pretrends, slope(0.2) pre(1) post(2/10) b(beta) v(sigma) assert _rc == 198— Reply to this email directly, view it on GitHub https://github.com/mcaceresb/stata-pretrends/pull/6#issuecomment-2122782655, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE6EXFDT7QRZBS7R4RBPOFLZDNLSZAVCNFSM6AAAAABGFEMCLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRSG44DENRVGU . You are receiving this because you were mentioned.Message ID: @.***>