Announcement

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

  • ipwra with survey desgin

    Hello, I'm trying to implement an IPWRA using data from a survey, the survey data includes sample weights, stratification, and PSU variables. If I implement IPW, would it be appropriate to substitute the survey-provided probability weights with the IPW variable? I attached some STATA code to this email, hopefully it makes sense as to what my issue is. The one thing I'm wondering if it's appropriate to estimate the treatment model with the original survey weights and then change to the IPW weights in the outcome regression while keeping the same stratification and psu method. I also included a -dataex- of the variables. My treatment variable is -shootings- total number of fatal and non-fatal shootings (truncated) is a count variable. In contrast, my outcome variable, -dentist-, is a binary variable indicating a dental visit in the previous year.

    Code:
    
    ******Treatment model*****
    ****controls*****
    local controls i.sex i.race 
    
    *****treatment model******
    
    svyset psu [pweight = weight], strata(stra)  
    
    svy: mlogit shootings `controls', rrr
    
    *****Predict the conditional probability******
    predict p_shoot, pr
    
    ****creating inverse probability weights****
    gen ipw=.
    
    replace ipw = 1/P_shoot if shootings==1|shootings==2
    replace ipw = 1/(1-P_shoot) if shootings==0
    
    ****outcome regression****
    svyset psu [pweight = ipw], strata(stra)  
    
    svy: logit dental i.shootings `controls', or

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte(aid dentists shootings sex race)
     1 0 2 1 2
     2 1 1 0 0
     3 1 0 1 1
     4 0 0 0 3
     5 1 0 0 2
     6 1 1 1 0
     7 0 2 0 1
     8 1 0 1 2
     9 0 2 1 3
    10 1 1 0 1
    11 1 0 0 0
    12 0 1 1 2
    13 1 2 1 3
    14 0 0 0 0
    15 0 2 0 1
    16 1 0 1 2
    17 1 1 0 1
    18 0 1 1 3
    19 1 0 0 0
    20 0 2 1 2
    21 1 1 1 3
    22 0 0 0 1
    23 1 2 0 0
    24 0 1 0 1
    25 1 0 1 2
    end

  • #2
    Hi Luis, maybe this thread might help you: https://www.statalist.org/forums/for...sample-weights

    Best regards,
    Daniel

    Comment

    Working...
    X