1

In Stata I am trying to only keep specific variables in a coefficient plot, and I am using the drop() option but it is not working well although it is not producing any errors. coefplot is a community-contributed command, and here is more information on it.

Here is a data example of my dataset:


* Example generated by -dataex-. For more info, type help dataex
clear
input float(income DiD_implementation treated_area treatment_time)
     300   0 1 1 1
     232  0 1 1 1
     351  0 0 1 0
     167   0 0 1 0
     322  0 1 1 1
     98   0 0 1 0
     437   0 1 1 1
     311   0 1 1 1
     735   0 0 1 0
     207   0 0 1 0
diff income, t(treated_area ) p(treatment_time)

Here is the model's outcome:

DIFFERENCE-IN-DIFFERENCES ESTIMATION RESULTS
Number of observations in the DIFF-IN-DIFF: 61278
            Before         After    
   Control: 11876          19262       31138
   Treated: 11587          18553       30140
            23463          37815
--------------------------------------------------------
 Outcome var.   | income| S. Err. |   |t|   |  P>|t|
----------------+---------+---------+---------+---------
Before          |         |         |         | 
   Control      | 3.079   |         |         | 
   Treated      | 5.198   |         |         | 
   Diff (T-C)   | 2.120   | 0.195   | 10.84   | 0.000***
After           |         |         |         | 
   Control      | 1.800   |         |         | 
   Treated      | 1.816   |         |         | 
   Diff (T-C)   | 0.017   | 0.154   | 0.11    | 0.914
                |         |         |         | 
Diff-in-Diff    | -2.103  | 0.249   | 8.45    | 0.000***
--------------------------------------------------------
R-square:    0.01
* Means and Standard Errors are estimated by linear regression
**Inference: *** p<0.01; ** p<0.05; * p<0.1

Building off Cibernik's recommendation, the code below worked well:

coefplot income, xline(0) drop(_cons treated_neighborhood treatment_time)

Below is the outcome: enter image description here

nesta13
  • 95
  • 6
  • 2
    Upvoted for the effort to present a structured question, but 1) update the data example to something more representative (currently income is always zero i.e. zero estimates); and 2) link to image is broken. – JR96 Mar 02 '22 at 18:35
  • Thanks, I have updated the post. – nesta13 Mar 02 '22 at 18:43
  • 1
    I think it should be `coefplot, drop(_cons treated_area treatment_time)` (without the asterisks, full stops and commas). – Bicep Mar 02 '22 at 23:17
  • Thanks, super helpful! I have updated my post. – nesta13 Mar 03 '22 at 11:33

0 Answers0