Announcement

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

  • How to Detect Leverage Points/ Influential Observations

    I'm working with human opportunity index (hoi) and I am applying the 'hoi' command that is defined by a program in the ssc. In general, it initially estimated logistic regression and using the probability of a positive outcome to calculate the index (HOI).
    My database is composed of variables originating from a search of a Brazilian official statistics institute and variables that I created from them using mathematical operations such as average, difference and logarithm. The base contains observations for 27 states over 10 years, and from it I generate the index (HOI) for each state and year, ie, are 270 indices calculated, which is done through a unique code that was created from a request for help made in a previous topic I created this forum (code below).


    capture postutil clear
    postfile handle ufs ano hoi_1 d_1 p_1 using hoi_sanea, replace

    local predictors sexo raca presmae area logrenpcdef nmorad refsexo ncrian medescresp difescresp

    local outcomes sanea

    levelsof uf, local(ufs)
    foreach c of local ufs {
    levelsof ano if uf == `c', local(anos)
    foreach y of local anos {
    display "uf = `c', ano = `y'"
    foreach o of varlist `outcomes' {
    capture noisily hoi `o' `predictors' [fw = pesopes] ///
    if uf == `c' & ano == `y', format(%9.3f) estimates decomp1
    if c(rc) == 2000 { // hoi FAILED DUE TO NO OBSERVATIONS
    display "Nao ha observacoes ou o outcome nao e dicotomico `o': analise ignorada"
    }
    else if c(rc) != 0 { // SOME OTHER ERROR AROSE ATTEMPTING hoi
    display in red "Erro encontrado ao executar o ioh com o outcome `o', uf = `c', ano = `y'"
    exit c(rc) // SHOW ERROR CODE AND STOP
    }
    if c(rc) ==0 post handle (`c') (`y') (`r(hoi_1)') (`r(d_1)') (`r(p_1)')
    }
    }
    }


    postclose handle
    It happens, however, I want to make a leverage analysis to detect influential observations but do not know how to do, since I have to deal with the set of observations for each combination state-year as a database (ie, are 270 databases), and besides, I do not squeegee logistic regressions for each state and year, but a complete code that is only completed when all 270 indexes (HOI) are calculated.
    I would like the help of Statalist members to know how can I leverage analysis to detect influential observations.

    Thanks in advance

    Girlan
    Last edited by Girlan Oliveira; 13 May 2016, 14:58.
Working...
X