Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: implementation of boschloo's test: very slow execution


From   "Eva Poen" <[email protected]>
To   Statalist <[email protected]>
Subject   Re: implementation of boschloo's test: very slow execution
Date   Mon, 3 Mar 2008 10:00:09 +0000

Joseph,

thank you very much for your program to calculate the boschloo test.
What a great idea to employ -ml- for the task; I'd never had thought
of it myself.


2008/2/29, Joseph Coveney <[email protected]>: [excerpts]
>
>  The approach below stays within Stata 9.2 and speeds things up without going
>  to Mata.  With it, execution time for Eva's 30-minute example is down to
>  about 40 seconds on my machine.

This is an amazing improvement over what I have got now, especially
since there is no trade-off between execution time and precision, as
it is in my implementation.

>  Experience might warrant lowering or raising
>  the hard-coded default of 100--a repeat of 50 worked for Eva's example, but
>  for insurance I've doubled that for the default.  A repeat of 10 doesn't
>  work reliably:  it resulted in -ml- converging on a local maximum the first
>  time (start-up random number seed) and on the global maximum in a second run
>  with the next-in-line random number seed.

I will recalculate all p-values using your program and play around
with this default, to see what difference it makes in various
situations. If I can find a reliable pattern, I will report back.

> The -ml search- bounds and -ml
>  plot- bounds are both set for a theta from 0.01 to 0.5 by default, although
>  these are both options for the user.  (At least for Eva's example, a plot
>  throughout the entire range of theta is symmetric about theta = 0.5, so that
>  the supremum is present twice in the set.  I don't know whether that's true
>  in general, and so the bounds are left as options.

The function appears to be symmetric in many situations. However, if
the original fisher's test p-value is very large, and thus the
Boschloo p-value is going to be large as well, the function is not
necessarily symmetric around 0.5, and making that assumption would
result in an inaccurately low p-value.

>  There are two ado-files below, -boschloo.ado- and -boschloo_ll.ado-.  They
>  must be saved separately where Stata can find them (-help adopath-); the
>  former calls the latter.  There is also an example do-file that runs Eva's
>  example* with -ml search- (default) and -ml plot- options, as well as
>  illustrates user-set bounds.  -if-, -in-, and -nolog- options are available,
>  but aren't illustrated.

Fantastic implementation, Joseph; I'm thrilled. I will make an
immediate version of your command as soon as I have a little bit of
time.

Thanks,
Eva
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index