Announcement

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

  • t-test: Table for difference in means with weighted data

    Hi,

    after conducting a Propensity Score Matching using -psmatch2- I would like to report a Covariate Balance Test using my matched sample as shown in the appendix. That is, for my matched sample, I would like to compare the means of the covariates in the control group to the means of my covariate in the treatment group and test if they differ significantly from one another. It appears that -psmatch2- doesn't offer an in-build solution so I tried to recreate the table manually. However, I don't really know how to consider the weights as for some observations the frequency with which the observation is used as a match is greater than 1.
    Also, is there a way to calculate the normalized differences in matching covariates, which is calculated as the difference in means for treatment and match groups divided by the square root of the average of the group variances?
    I came across the user written -covbal- command but it doesn't seem that the command is able to calculate the t-stat.

    Simplified example data:
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte(Age Gender) double _pscore byte _treated double _weight
    52 1  .3947406108202798 1 1
    39 1 .19769783322231907 0 .
    45 1                  . . .
    53 1 .24449345450987864 0 1
    48 1 .24923599577139546 0 .
    59 1  .3448560489529331 0 .
    53 1 .33063039223691654 0 .
    53 1                  . . .
    47 1  .2577372960636437 0 2
    47 1   .261890726691415 0 2
    48 1                  . . .
    37 1 .13123258590836206 1 1
    46 1                  . . .
    47 1  .2044286741132987 0 1
    52 1                  . . .
    50 1 .24599059356946074 1 1
    48 1 .21990041457446305 0 .
    47 0 .41767316598442744 0 .
    56 1 .31081229801541926 1 1
    43 1 .24991157206365444 0 1
    47 1  .3866279160441929 0 1
    49 1  .2539011751731308 0 .
    53 1 .24412786224820815 0 .
    50 1                  . . .
    43 1 .19625058147402055 0 .
    50 1 .23973877522019316 0 .
    48 1  .2516539040776592 0 .
    57 1 .25676242566795576 1 1
    49 1 .22187617729010792 0 .
    42 1                  . . .
    44 1 .18042964728584043 0 .
    45 1 .28737049977514123 1 1
    58 1  .2753286621339725 1 1
    49 1 .24810241634017663 0 .
    51 0 .29429668521632263 0 .
    43 1 .20253030528252797 0 .
    43 1 .20764687281434016 0 .
    45 1 .21153485748923867 1 1
    55 1  .2368621605057569 0 .
    58 1  .4963069177478678 1 1
    61 1   .351835871953627 1 1
    53 1  .3375273741862841 0 1
    50 1  .2687606840778219 0 .
    62 1  .2878661910516782 1 1
    58 1  .2740792667827789 0 .
    62 1  .2882877044721498 1 1
    54 1  .3540574103289794 0 .
    60 1                  . . .
    52 1  .2167445061521019 0 2
    55 1 .26647703827364577 1 1
    end
    label values Gender Gender
    label def Gender 0 "F", modify
    label def Gender 1 "M", modify
    label values _treated _treated
    label def _treated 0 "Untreated", modify
    label def _treated 1 "Treated", modify
    In the sample dataset 24 observations are included in the matched sample:
    Code:
    egen sum = total(_weight)
    If I would ignore the weights when calculating the t statistic, Stata would only consider the non-missing observations from _weight which would be 21 (and thus ignore the fact that some observations are matched more than once)
    Thanks for you help
    Click image for larger version

Name:	Outcome.png
Views:	1
Size:	46.7 KB
ID:	1678099

  • #2
    Marc, psmatch2 (from SSC) does have a built-in post-estimation command: Run pstest after psmatch2, and you'll see what you need.

    Comment


    • #3
      Thanks Fei, this is really helpful!

      Comment

      Working...
      X