Announcement

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

  • kmatch standardized bias

    Dear Statalisters,

    I am using
    Code:
    kmatch
    to do matched difference-in-difference.
    I want to calculate the standardized bias to check the balance of the covariates after the matching.
    Code:
     kmatch summarize
    The summarize gives only mean, difference and standard deviation and ratio.

    Is there a way to calculate the standardized bias using this command (something that I missed in the do-file) or through matrices?

    Thank you.

    Best regards,
    Maye

  • #2
    Hello, I am trying to solve the very same issue. Hopefully, someone responds.

    Comment


    • #3
      I found this definition of PS bias: "Standardized Bias = Covariate Effect Size = Difference in mean covariate value divided by the standard deviation of treated group"

      You can compute this by yourself, altough it is a bit of coding. You could for sure write a loop to compute this for many vars but simply here one example:

      Code:
      sysuse nlsw88, clear
      keep if !missing(union)
      kmatch ps union hours collgrad south (wage), wgen(w)
      
      *** Before matching ***
      sum hours if union == 1
      local tmean = r(mean)
      local tsd = r(sd)
      
      sum hours if union == 0
      local cmean = r(mean)
      
      di "Before PS: " (`tmean' - `cmean') / `tsd'
      
      *** After matching ***
      sum hours if union == 1 [aweight=w]
      local tmean = r(mean)
      local tsd = r(sd)
      
      sum hours if union == 0 [aweight=w]
      local cmean = r(mean)
      
      di "After PS: " (`tmean' - `cmean') / `tsd'
      Best wishes

      (Stata 16.1 MP)

      Comment


      • #4
        Hi Statalist,

        Is anyone clever enough to put this into a "foreach" loop and generate multiple uniquely named variables to plot together in a twoway scatter?

        Potentially some clues here
        HTML Code:
        https://www.statalist.org/forums/forum/general-stata-discussion/general/1413751-scalar-in-a-foreach-loop
        but I am getting myself in a loop trying to work it out.

        Cheers,
        Hannah

        Comment


        • #5
          covbal

          will give you standardized differences.

          Comment


          • #6
            Hi George,

            Im was looking to graph the bias and variance ratio before/after inverse probability weighting - managed to figure out how to do the standardised difference using pbalchk, but struggling with the other two as pstest only works with matching strategies (as far as I'm aware).

            Thanks again,
            Hannah

            Comment

            Working...
            X