Announcement

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

  • Propensity Score Matching with Categoric Variables

    Dear Stata Users,

    I have a dataset which consists of all categoric variables. I am doing different matching methods such as nearest neighbor matching (attnd in stata), radius matching (attr), etc. As you know before applying these methods, I need to get the scores. In doing so, I am trying to utilize "pscore". However, the error message states that "factor variables and time-series operators not allowed".

    Can you please give me some suggestions to solve this problem?

    Hope I've made my question clear.
    Thanks,
    Abdullah.

  • #2
    Abdullah,

    Without more details on exactly what you did, it's hard to say if and how you can fix this problem. I would recommend using psmatch2 (from SSC) which also computes propensity scores and seems to have less problems than the older methods.

    If all you want is the propensity scores, you can simply run a logistic regression (logistic or logit) with the treatment as the dependent variable and then use predict to calculate the predicted probabilities.

    Regards,
    Joe

    Comment


    • #3
      Hi,
      The user-written -pscore- command does not allow the "i." indicator before variables. You can still calculate a propensity score with -pscore-, but you'll need to remove the "i." prefix from categorical variables.
      Hope this helps,
      Melissa

      Comment


      • #4
        In addition to Joe comments,
        In my experience most of user written programs have difficulties using the factor notation.
        for instance, you might not be able to run:
        pscore y i.x i.z
        but you should have no problems running:
        xi:pscore y i.x i.z
        Best,
        Fernando

        Comment


        • #5
          If you are using Stata 13 you may also want to look at the new teffects commands. These commands are built-in Stata commands and do allow factor variable notation.
          You can calculate the propensity scores using the predict command with the ps option after teffects. See the post-estimation help file for teffects for more information.

          Comment


          • #6
            Hi Joe,

            Thanks for quick reply.

            I tried "psmatch2" and it works pretty well. But it seems to me (may be I am wrong) that the older method is better than "psmatch2" in some sense. What do you think?

            It is not that I only need propensity scores. After getting propensity scores I need to use them in a matching method. I also tried this: I ran a "probit" regression and then use the "predict" command to get the predicted probabilities as you said and utilize this result with attnd and attr. But it still gives me the same result.

            I don't know if it's a convenient way to show the problem or not. But here it is:

            " pscore treated urban male i.health_status i.education , pscore(myscore) blockid(myblock) comsup "

            factor variables and time-series operators not allowed
            r(101);

            Should I stick with the newer methods such as "psmatch2" instead of trying to do it with this old method?

            Best,
            Abdullah.

            Comment


            • #7
              Hi all,

              Thanks for your replies.

              Melissa: I thought about making dummies. However, then I thought the data would be so complicated. Are you also referring to a dummy solution or something else?

              Fernando: What you suggested worked. However, I am still not sure about why we are using " xi " command. I will search for this command and see how it works.

              Sarah: I will check on teffects. This would be a good idea too.

              Thank you so much for your responses.
              Abdullah.

              Comment


              • #8
                Abduallah,

                I'm sure there are advantages and disadvantages to both pscore and psmatch2. In this case, one advantage of psmatch2 is that is can handle factor notation. There are some others which I have forgotten about since I stopped using pscore. psmatch2 can do the matching, as well, including nearest neighbor and radius.

                Regards,
                Joe

                Comment


                • #9
                  -pscore- and -psmatch2- work well in conjunction with one another - you can use -pscore- to evaluate the balance of the initial specification of your propensity score, and you can use -psmatch2- to match your observations with the covariates you tested in -pscore-

                  And yes, I was suggesting making dummy variables for each level of your categorical variable (barring the reference category).

                  Comment


                  • #10
                    Thank you all for your replies again.

                    Comment


                    • #11
                      Dear Melissa
                      do the pscore and psmatch2 work with both continuous and categorical covariates?

                      Comment

                      Working...
                      X