drop() option not working in coefplot package in Stata

436 Views Asked by At

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

0

There are 0 best solutions below