Announcement

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

  • How to Plot Heterogeneous Treatment Effect

    Hi,

    I would like to ask how to plot this particular logit regression. I have 3 groups of people - 2 treated and one control group. They are classified as X1 and X2 binary variable where X1 is 1 if the person is treated with treatment A and X2 is 1 if the person is treated with treatment B. My dependent variable is Y where it is 1 if the person buys the medicine. I have control variables such as age , educational status and income levels and fixed effects. Also, I have interacted the binary variables with age. I would like to ask how do I plot the logit model to see the heterogeneous treatment effects by age? By the way, I am using Stata 12.

    Thanks so much and have a great week ahead.

  • #2
    You should begin by reading the folowing:
    Code:
    help margins
    help marginsplot
    help fvvarlist​
    Then, you can do something like:

    Code:
    g group=cond(x1==1,1,cond(x2==1,2,0))
    la de group 0 "control" 1 "treatment A" 2 "treatment B"
    la val group group
    logit Y i.group##c.age education income i.fixed_effects
    margins group, at(age=(20(10)60))
    marginsplot, noci

    Comment


    • #3
      Remember you need to be sure you have no hidden variable before saying a regression is causal (which makes it hardly possible at all).

      To be honest I would advise you to investigate the problem a bit further, perhaps using propensity score matching treatment effects procedures with one of the two following statements :
      Code:
      psmatch2
      teffects
      These procedures will allow you to "predict" counterfactual outcomes based on observational twins (i.e. observations that had the same probability of receiving treatment), better than regression would do, because based on overlapping samples.

      After doing that, you could overlay, for both treatment 1 and treatment 2, the "predicted" counterfactual outcome and the "real" treated outcome. Your X axis could be, say, the rank in the real outcome, which you can compute using
      Code:
      egen myrank = rank(outcome), by(treatment)
      or some covariate of your choice (age etc).

      Hope this helps
      Joe

      Comment


      • #4
        Thanks so much! I would try to read through them again as I was unsure of the method to do so. The thing is that I have 3 age groups, 30 to 40, 40 to 50 and 50 to 60. Initially, I wanted to isolate the 30 to 40 years old by using an (if) condition at the end of the regression command and plot the logit regression without the age interaction. Would this regression be valid? I am sorry if this sounds rudimentary as I am still a student.

        Thanks again.
        Last edited by Ng Luke; 10 Sep 2015, 00:51.

        Comment


        • #5
          You're welcome! Running separate regressions on subsamples is most of the time OK IMHO and can yield interesting results, but mind your coefficients could lack significance because of small sampling. Also mind where you cut the sample, it needs to be logical (ages 40 and 50 in your case), for that you need a bit of descriptive statistics to support your choices.

          [Btw : welcome to Statalist - it would be highly appreciated that you use your full name and surname as user name.]

          Kind regards,
          Joseph

          Comment


          • #6
            Hi Oded,

            I was reading the guides you told me to refer to and I have one question that I was hoping you can help me with.

            1) For the code: margins group, at(age=(20(10)60)), Could you explain why did you do this? Is it possible for me to plot a regression by having an interaction term whereby age interacts with the treatment groups and then i use margins dy/dx to get the marginal effects of the interaction term?

            Thanks so much.

            Luke

            Comment

            Working...
            X