Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: problem with -bca- option with bootstrapping a user-written program


From   "Smith, Paul Bradley" <[email protected]>
To   <[email protected]>
Subject   RE: st: problem with -bca- option with bootstrapping a user-written program
Date   Fri, 2 Dec 2005 14:08:40 -0600

Thanks for a quick solution to that problem.   The routine runs just
fine with the false argument.  

In getting the routine to run, Because -stci- leaves a value for N in
e(), the jackknife sample was limited to only part of the whole dataset.
The jackknifing runs fine (producing no output), followed by the
bootstrap, but then at the end, no bca confidence interval.  When I
issued -estat bootstrap, all--, I got:

	option bca requires BCa confidence intervals to be saved by the
bootstrap prefix command
	r(198);

The excerpt below shows only 100 replicates of the bootstrap to speed up
the test,  but I got the same error for 2000 replicates.  

I did the same test with a simple difference of means from -sum-,
avoiding all the survival analysis overhead and the same issue arises --
the estimates necessary for bca computation don't appear to be
available.

Thanks again,


--brad smith

---output---
. 
. bootstrap ratio=r(difference), bca nodrop reps(100): myDifference 0
(running myDifference on estimation sample)

(running myDifference on estimation sample)

Jackknife replications (1069)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
<edited for brevity>
..................................................  1050

Jackknife results                            Number of obs      =
1069
                                             Replications       =
1069

Bootstrap replications (100)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100

Bootstrap results                            Number of obs      =
1069
                                             Replications       =
100

      command:  myDifference 0
        ratio:  r(difference)

------------------------------------------------------------------------
---
          |   Observed   Bootstrap                         Normal-based
          |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-----------+------------------------------------------------------------
----
    ratio |   17.40955   6.989031     2.49   0.013     3.711297
31.10779
------------------------------------------------------------------------
----


. estat bootstrap, all

Bootstrap results                            Number of obs      =
1069
                                             Replications       =
100

      command:  myDifference 0
        ratio:  r(difference)

------------------------------------------------------------------------
----
           |    Observed               Bootstrap
           |       Coef.       Bias    Std. Err.  [95% Conf. Interval]
-
---------+--------------------------------------------------------------
--
     ratio |   17.409546  -.5694048   6.9890307    3.711297   31.10779
(N)
           |                                       3.059515   32.25432
(P)
           |                                       3.242396   33.54528
(BC)
------------------------------------------------------------------------
---
(N)    normal confidence interval
(P)    percentile confidence interval
(BC)   bias-corrected confidence interval

. 

. estat bootstrap, bca
option bca requires BCa confidence intervals to be saved by the
bootstrap prefix command
r(198);







-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jeff
Pitblado, StataCorp LP
Sent: Friday, December 02, 2005 1:13 PM
To: [email protected]
Subject: Re: st: problem with -bca- option with bootstrapping a
user-written program 

Smith, Paul Bradley <[email protected]> is having trouble using the
-bca-
of -bootstrap- with his program -myDifference-:

> I have a user written program that computes the difference between two
> mean survival times.  It's been running quite well in a variety of
> incarnations.  Today I decided to add the -bca- option to the
> -bootstrap- command, but it bombs.
> 
> 
> 	. bootstrap r(difference), nodrop reps(200) bca : myDifference
> 	(running myDifference on estimation sample)
> 
> 	last estimates not found
> 	r(301);
> 
> 
> I searched StataList and found a late October reference to a bug in
> bootstrap, so I updated my ADO files but still get the same problem.
> I'm guessing that this has something to do with my user-written
program
> being unfriendly to jknife.  Anyone have any suggestions that might
> enable the -bca- option?

Paul has discovered a bug in -jackknife- that tries to replay results
when
supplied with a command that has no arguments.  We have a fix that will
be
available in the next ado-file update.  In the mean time, Paul can add
an
argument to his call to -myDifference- such as

	. bootstrap r(difference), nodrop reps(200) bca : myDifference 0

Given his definition of -myDifference-, the '0' will be ignored but has
the
effect of making it clear to -jackknife- that it should not try to
replay
results.

--Jeff
[email protected]
*
*   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/

*
*   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