Announcement

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

  • Manually computing threefold OB decomposition using cotton/nuemark weights

    Hi Users
    I am trying to compute a threefold decomposition manually. I am using the non-discriminatory beta star coefficient using the Cotton and Nuemark method. As STATA's "oaxaca" command doesn't allow threefold with these weighting methods, I have to do it interactively. However, to ensure that I am doing it correctly, I tried "nldecompose," which produces decomposition in terms of Advantage and Disadvantage factors and does not match the coefficient and interactive factor that I have computed. Please check the steps. (Dummy data "zodel.dta" attached)

    *Threefold OB with nuemark** (PART-A)
    ***********************
    clear
    use zodel
    qui {
    count if group == 0
    local n0 = r(N)
    count if group == 1
    local n1 = r(N)
    local ntotal = `n0' + `n1'
    local w0 = `n0' / `ntotal'
    local w1 = `n1' / `ntotal'
    qui reg y x1 x2 x3 if group==0
    matrix b_A = e(b)
    qui reg y x1 x2 x3 if group==1
    matrix b_B = e(b)
    matrix b_star = 0.5*b_A+0.5*b_B
    qui tabstat x1 x2 x3 cons if group==0, stat(mean) save
    matrix X_A = r(StatTotal)'
    qui tabstat x1 x2 x3 cons if group==1, stat(mean) save
    matrix X_B = r(StatTotal)'
    * Total difference
    matrix total_diff = (b_A*X_A) - (b_B*X_B)
    * Calculate the endowment effect (Explained part)
    matrix endowment = b_star*(X_A-X_B)
    * Calculate the coefficient effect (Unexplained part)-Disadv
    matrix coefficient = (b_A- b_star)*X_A
    * Calculate the interaction effect-Adv
    matrix interaction = (b_star-b_B)*X_B
    mat Z = total_diff\endowment\coefficient\interaction
    noi mat list Z
    }

    However
    nldecompose, by(group) threefold omega(neumark) : reg y x1 x2 x3

    above produces the same results as the following syntax(s) (PART-B)

    clear
    use zodel
    qui {
    count if group == 0
    local n0 = r(N)
    count if group == 1
    local n1 = r(N)
    local ntotal = `n0' + `n1'
    local w0 = `n0' / `ntotal'
    local w1 = `n1' / `ntotal'
    qui reg y x1 x2 x3 if group==0
    matrix b_A = e(b)
    qui reg y x1 x2 x3 if group==1
    matrix b_B = e(b)
    qui reg y x1 x2 x3
    matrix b_star = e(b)
    qui tabstat x1 x2 x3 cons if group==0, stat(mean) save
    matrix X_A = r(StatTotal)'
    qui tabstat x1 x2 x3 cons if group==1, stat(mean) save
    matrix X_B = r(StatTotal)'
    * Total difference
    matrix total_diff = (b_A*X_A) - (b_B*X_B)
    * Calculate the endowment effect (Explained part)
    matrix endowment = b_star*(X_A-X_B)
    * Calculate the coefficient effect (Unexplained part)-Disadv
    matrix coefficient = (b_A- b_star)*X_A
    * Calculate the interaction effect-Adv
    matrix interaction = (b_star-b_B)*X_B
    mat Z = total_diff\endowment\coefficient\interaction
    noi mat list Z
    }

    H0: I guess the "nldecompose" doesn't split in terms of coefficient and interaction factor (or my formulation (part A) is correct)
    Attached Files
Working...
X