Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bias-corrected and accelerated bootstrap analysis cannot be computed.

    Hello everyone,
    I am trying to get estimates and 95% CI using BCa approach but not successful at it. I get the N, P and BC confidence intervals and a warning that says - "jackknife returned missing acceleration estimates. BCa confidence intervals cannot be computed." How do I correct for it and get the BCa values? Below is my code. Any guidance is highly appreciated. Thank you!

    program drop calculate_sensitivity
    program calculate_sensitivity, rclass
    args x y
    summarize `y' if `x'==1
    return scalar sensitivity=r(mean)
    summarize `y' if `x'==0
    return scalar specificity=1-r(mean)

    end

    // Bootstrap sensitivity using BCa
    bootstrap r(sensitivity) r(specificity) , cluster(patient_id) reps(1000) saving(cataract, replace) bca seed(2): calculate_sensitivity cataract_gold cataract_test

    estat bootstrap, all



    -Kamini

  • #2
    If you read the help files, you'll see for bootstrap, "If the bca option is supplied, command must also work with jackknife; see [R] jackknife."

    And there, "Most Stata commands and user-written programs can be used with jackknife, as long as they follow standard Stata syntax and allow the if qualifier . . ."

    I can't vouch for what you're doing with respect to computing diagnostic discrimination measures, but as far as getting the program to work, maybe try something more along the following lines (untested).
    Code:
    program calculate_sensitivity, rclass
        version 18.0
        syntax varlist(numeric min=2 max=2) [if]
    
        marksample touse
    
        gettoken x y : varlist // args x y
    
        summarize `y' if `x' & `touse', meanonly // x missing is already eliminated
        tempname sen n
        scalar define `sen' = r(mean)
        scalar define `n' = r(N)
    
        summarize `y' if !`x' & `touse', meanonly
        return scalar specificity = 1 - r(mean)
        return scalar N = r(N) + `n'
        return scalar sensitivity = `sen'
        
    end
    And reading further in the help file for jackknife, you'll see that it's best also to report the sample count used in computing whatever it is that you're returning, which I think in your case means that you're better off computing the two diagnostic thingies separately in separate programs (ado-files), returning the count of only those observations that contribute to computing the thingy being returned.

    That is, split up what you've got (and the modification of it that I show just above) into two separate programs, one for sensitivity and another for specificity, and compute the bias-corrected accelerated bootstrap statistic for each separately.

    Comment


    • #3
      Thank you, your code was extremely helpful, I did get BCa based CI estimates from it!

      Comment

      Working...
      X