Announcement

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

  • Difference-in-difference test

    Hi,

    I have a hand-collected dataset regarding a specific negotiation event (data listed below). This negotiation data only covers some manufacturing firms (since it is very time-consuming to hand collect data). I want to merge this dataset to my main data which covers all kinds of firms to conduct a difference-in-difference test. I can merge these two data by gvkey and year. Could you please let me know how to do this DID analysis?

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int year long gvkey float Eventdummy
    2004 1225 1
    2009 1225 1
    2014 1225 1
    2019 1225 1
    2018 1230 1
    2004 1240 1
    2008 1240 1
    2013 1240 1
    2015 1240 1
    2011 1279 1
    2005 1300 1
    2006 1300 1
    2007 1300 1
    2017 1300 1
    2001 1356 1
    2006 1356 1
    2011 1429 1
    2007 1526 1
    2010 1526 1
    2015 1526 1
    2004 1567 1
    2006 1567 1
    2010 1567 1
    2005 1742 1
    2010 1742 1
    2003 2136 1
    2004 2136 1
    2005 2136 1
    2006 2136 1
    2007 2136 1
    2008 2136 1
    2010 2136 1
    2013 2136 1
    2003 2285 1
    2005 2285 1
    2008 2285 1
    2012 2285 1
    2014 2285 1
    2006 2393 1
    2003 2663 1
    2005 2663 1
    2006 2663 1
    2007 2663 1
    2005 2783 1
    2005 2784 1
    2008 2784 1
    2004 2817 1
    2005 2817 1
    2011 2817 1
    2017 2817 1
    2005 3036 1
    2000 3362 1
    2003 3362 1
    2006 3362 1
    2010 3362 1
    2004 3392 1
    2004 3413 1
    2005 3422 1
    2008 3502 1
    2010 3502 1
    2006 3532 1
    2007 3532 1
    2010 3532 1
    2004 3650 1
    2010 3708 1
    2003 3734 1
    2005 3734 1
    2004 3835 1
    2007 3835 1
    2009 3835 1
    2010 3835 1
    2015 3835 1
    2013 3897 1
    2003 3980 1
    2007 3980 1
    2003 4062 1
    2007 4503 1
    2004 4798 1
    2011 4798 1
    2013 4798 1
    2007 4839 1
    2008 4839 1
    2011 4839 1
    2006 5046 1
    2008 5046 1
    2014 5046 1
    2007 5047 1
    2019 5047 1
    2003 5073 1
    2007 5073 1
    2006 5134 1
    2005 5135 1
    2016 5135 1
    2004 5151 1
    2008 5151 1
    2012 5151 1
    2006 5234 1
    2007 5518 1
    2010 5597 1
    2007 5709 1
    end

  • #2
    Here is a good general reference about DID estimation. https://www.annualreviews.org/doi/pd...-040617-013507.

    If you want specific advice you will need to tell more about the problem: what is in the other data set, what are the variables of interest? What is the "treatment?" Did all treated units undergo the treatment at the same time? I would also recommend showing an example of the data set that results when you merge the two data sets you currently have. When you do that, be sure to include in your example both firms that got the treatment and firms that didn't. And be sure to include data from both before and after treatment on those firms.

    Also, in your example in #1 the "variable" Eventdummy is 1 in every observation. I hope that is not true of the full data set, because if so, this "variable" is a constant and is, therefore, useless.

    Comment

    Working...
    X