Announcement

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

  • How to incorporate inverse probability weighting (IPW) in plotting kernel density of propensity score?

    Dear Statalist users,

    I am using IPW method to estimate average causal effect of a binary exposure. I am interested in comparing the kernel density of propensity score of the exposed/unexposed in unweighted and IPW weighted space. Plotting the kernel density in the weighted space involves specifying the weight option.

    STATA documentation for "kdensity — Univariate kernel density estimation" states that fweights, aweights, and iweights are allowed. However, in my understanding, IPW is a pweight, so none of the allowed weights works?

    My questions are:
    • Is IPW a pweight? If it is, how to incorporate IPW in plotting kdensity when pweights are not allowed.
    • Maybe IPW is an aweight? Why?
    Many thanks
    Qunyan






  • #2
    aw

    Comment


    • #3
      Hi George,
      Thank you for the reply, but why? Quoting from STATA documentation (underlined), we have:

      2. pweights, or sampling weights, are weights that denote the inverse of the probability that the observation is included because of the sampling design. I think IPW is a pweight, because with IPW method, a pseudo-population is created. And the study sample can be thought to result from selecting individuals with a known probability of exposure depending on their covariate profile.

      3. aweights, or analytic weights, are weights that are inversely proportional to the variance of an observation; that is, the variance of the jth observation is assumed to be sigma^2/wj, where wj are the weights. Typically, the observations represent averages and the weights are the number of elements that gave rise to the average.
      IPW does not look like aweight to me. Observations in my data are individual observations. This contrasts to meta-analysis, observations are averages, hence naturally come with a variance. The IPW weight for each individual does not involve variance.

      Look forward to reading your further reply.

      Qunyan

      Comment


      • #4
        This was a duplicate of the post above.
        Last edited by Qunyan Xu; 08 Aug 2023, 18:10.

        Comment


        • #5
          pw and aw might give different standard errors, but the same means. since you're plotting, the SE does not matter.

          Code:
          sysuse auto, clear
          g id = _n
          
          psmatch2 foreign length turn headroom mpg , outcome(displacement) 
          svyset id [pw = _weight]
          
          summ displacement if foreign
          summ displacement if ~foreign
          
          svy, subpop(if foreign==1): mean displacement
          svy, subpop(if foreign==0): mean displacement
          
          summ displacement if foreign [aw=_weight]
          summ displacement if ~foreign [aw=_weight]
          
          summ displacement if foreign [iw=_weight]
          summ displacement if ~foreign [iw=_weight]

          Comment


          • #6
            Yes, this explains! Thank you very much!

            Comment

            Working...
            X