Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Problem with confidence intervals in stptime when using weights


From   [email protected] (Isabel Canette, StataCorp LP)
To   [email protected]
Subject   Re: st: Problem with confidence intervals in stptime when using weights
Date   Tue, 13 Mar 2012 15:45:55 -0500

Till Ittermann (Itterman(at)uni-greifswald(dot)de) discovered a bug in
-stptime-:

http://www.stata.com/statalist/archive/2012-03/msg00450.html

This problem is triggered when there is only one failure in a group and the
jackknife method is used to compute confidence intervals in -stptime-.  The
jackknife confidence intervals are reported by -stptime- when the -jackknife-
option is used or when -pweight-s are specified with -stset-, as in Till's
example.  We will fix this problem in a future update.

In the meantime, Till can use -poisson- to compute rates in this case.  This
can be performed by using the failure variable as a dependent variable, and
the time span for each observation as exposure in the model.  Here is an
example:

. webuse diet, clear
(Diet data with dates)

. set seed 1357

. gen pw = runiform()

. qui stset dox [pw = pw], origin(time dob) enter(time doe) id(id) ///
  scale(365.25) fail(fail==1 3 13) noshow

. gen exp = _t - _t0

. gen y = _d

. poisson y ibn.job [pw=pw], nocons irr  exp(exp) nolog

Poisson regression                                Number of obs   =        337
                                                  Wald chi2(3)    =     733.66
Log pseudolikelihood = -83.106567                 Prob > chi2     =     0.0000

------------------------------------------------------------------------------
             |               Robust
           y |        IRR   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         job |
          0  |   .0088572   .0029258   -14.31   0.000     .0046357    .0169229
          1  |   .0142757   .0041011   -14.79   0.000     .0081296    .0250686
          2  |   .0081916   .0022348   -17.61   0.000     .0047989    .0139828
     ln(exp) |          1  (exposure)
------------------------------------------------------------------------------

--Isabel
[email protected]
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index