Announcement

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

  • Bootstrapping in dominance analysis

    Dear Stata experts.

    using
    Code:
    webuse auto
    // Binary outcome dominance analysis with factor varaible (e.g., Azen & Traxel, 2009)
    Code:
    domin foreign trunk weight, reg(logit) fitstat(e(r2_p)) sets((i.rep78))
    // That order gives the ranking of variables based on their importance, from there, calculating the bootstrapping as in the help file is by mean of

    Code:
    bootstrap, reps(500): domin foreign trunk weight, reg(logit) fitstat(e(r2_p)) sets((i.rep78))
    // following each method i end up having same results which is not what i am looking for results

    General dominance statistics: Logistic regression
    Number of obs = 59
    Overall Fit Statistic = 0.5229

    | Dominance Standardized Ranking
    foreign | Stat. Domin. Stat.
    ------------+------------------------------------------------------------------------
    trunk | 0.0834 0.1595 3
    weight | 0.2611 0.4994 1
    set1 | 0.1783 0.3411 2


    My question is:
    - Using bootstrapping, how would it be possible to calculate the mean for dominance value for bootstrapped samples for the 500 samples.
    - How to calculate the a “reproducibility” value,which represents the proportion of bootstrapped samples that the given dominance pattern is produced. The closer the reproducibility value is to 1.00, the greater the robustness of the dominance results.

    Much appreciate your help.
    Last edited by ashraf abugroun; 12 Apr 2019, 11:38. Reason: Joseph Nicholas Luchman

  • #2
    Hi Ashraf,

    This can be done, but not by using the bootstrap prefix command as it defaults to the observed coefficients from the analysis without bootstrapping.

    I provide a reproducible example below for 10 bootstrap samples. To begin, I set up a few matrices to fill in the dominance statistics as well as the rankings. I then use a forvalues loop to obtain 10 bootstrap samples and estimate the focal command.

    Code:
    clear all
    
    set seed 05212019
    
    sysuse auto
    
    mata: result = J(3, 10, .)
    
    mata: ranks = J(3, 10, .)
    
    forvalues rep = 1/10 {
    
        preserve
        
        display "`rep'"
        
        bsample
    
        quietly domin foreign trunk weight, reg(logit) fitstat(e(r2_p)) sets((i.rep78))
        
        mata: result[., `rep'] = st_matrix("e(b)")'
        
        mata: ranks[., `rep'] = st_matrix("e(ranking)")'
        
        restore
        
    }
    Then the average statistics across repetitions can then be obtained using

    Code:
    mata: rowsum(result):/10
    The reproducibility value you ask for should be able to be obtained as below

    Code:
    domin foreign trunk weight, reg(logit) fitstat(e(r2_p)) sets((i.rep78))
    
    mata: sum(colsum(ranks:==st_matrix("e(ranking)")'):==3):/10
    - joe
    Last edited by Joseph Luchman; 21 May 2019, 08:00. Reason: error in last Mata line
    Joseph Nicholas Luchman, Ph.D., PStat® (American Statistical Association)
    ----
    Research Fellow
    Fors Marsh

    ----
    Version 18.0 MP

    Comment

    Working...
    X