Announcement

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

  • Bootsrapping using calculation formula

    Dear Colleagues,
    Can someone tell me why my code is note producing intervals (CI) when I do bootstrap: Below is my code and output

    **Directory changing
    cd "/Users/fodiwuor/OneDrive - Kemri Wellcome Trust/fodiwuor/studies/Pneumox/PneumoX2/CleanedBatchesTo_be_merged_Pneumoxdb"

    **program
    cap program drop _all
    program sen1, rclass
    version 15.1
    local R=0.875
    local R1=0.7104
    local Q=0.3077
    tempvar nt
    gen `nt'=(`R'*`Q')+(`R1'*(1-`Q'))
    local d=(`R'*`Q')+(`R1'*(1-`Q'))
    return scalar SEN1=`d'
    end

    bootstrap r(SEN1),reps(1000) seed (4) size(83): sen1





    Bootstrap results Number of obs = 83
    Replications = 1,000

    command: sen1
    _bs_1: r(SEN1)

    ------------------------------------------------------------------------------
    | Observed Bootstrap Normal-based
    | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    _bs_1 | .7610474 . . . . .
    ------------------------------------------------------------------------------






  • #2
    Originally posted by Fredrick orwa View Post
    Can someone tell me why my code is note producing intervals (CI) when I do bootstrap
    Because you're returning a constant.
    Code:
    . . .
    local R=0.875
    local R1=0.7104
    local Q=0.3077
    . . .
    local d=(`R'*`Q')+(`R1'*(1-`Q'))
    return scalar SEN1=`d'

    Comment

    Working...
    X