Announcement

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

  • Difference in Difference analysis - how to create a group variable

    I think my question is pretty straightforward. I'd like to know what my "Group" is for a difference in differences analysis.

    Study: Newspaper articles from 1985-2017 were categorized as either in favor, against, or neutral toward a specific topic. These are weighted and graphed.

    Click image for larger version

Name:	DID model.png
Views:	2
Size:	46.4 KB
ID:	1687088



    There is a clear divergence between the Favor and Against variables that happen roughly around 2007 or 2008. I would like to test this using a treatment variable defined as "before 2008" and "2008 and on," Treatment 0/1. The time is Year. I've added "the mean of the Favor and Against variables" for the control variable, Control.

    This is a mock-up of my data:

    Click image for larger version

Name:	data.jpg
Views:	1
Size:	54.2 KB
ID:	1687089


    The unit of analysis is newspapers for each year.
    But what's up with the Group? I know it's supposed to be categorical ... but what am I supposed to put?

    The syntax I have for the command is didregress (Favor) (Treatment), group(?????) time(Year)
    Any thoughts on what my Group should be?
    Thank you!

  • #2
    what is the treatment?

    Comment


    • #3
      I would like to test this using a treatment variable defined as "before 2008" and "2008 and on," Treatment 0/1.

      Comment


      • #4
        I think my question is pretty straightforward
        No it's not. Please, use dataex to show me how your real data look (not an excel file, not a verbal description, not a mock-up). By this, it isn't obvious what your unit variable is, and for us to proceed we need that.

        Comment


        • #5
          By this, it isn't obvious what your unit variable is
          A unit variable, huh?

          Here is the dataex. Just FYI, while dataex is a useful resource, some thoughts:
          1. Statalist allows attachments and links to external resources
          2. Stata also uses xmlsave/xmluse commands to export/import data in the post-safe (plain text) format. This is regularly posted on Statalist. And it saves variable formats and other decors as well. Also popular are excel files or photos. Both work just fine. Though, I understand if you have a preference.
          3. Verbal descriptions are essential for the community to understand the query.
          Code:
          * Example generated by -dataex-. For more info, type help dataex
          clear
          input int Year byte(Favor Against Neutral Treatment Control)
          1985  29 71  0 0 50
          1986  16 44 40 0 30
          1987  43 43 14 0 43
          1988  51 27 22 0 39
          1989  40 20 40 0 30
          1990  22 62 16 0 42
          1991  33 58  9 0 46
          1992  39 46 15 0 43
          1993  77 23  0 0 50
          1994  18 44 38 0 31
          1995  60 10 30 0 35
          1996  33 57 10 0 45
          1997  30 69  1 0 50
          1998  50  0 50 0 25
          1999  44 31 25 0 38
          2000  42 40 18 0 41
          2001  80 20  0 0 50
          2003  80 20  0 0 50
          2004   0 75 25 0 38
          2005  38  2 60 0 20
          2006 100  0  0 0 50
          2007  15 55 30 0 35
          2008  19 68 13 1 44
          2009  44 38 18 1 41
          2010  72 14 14 1 43
          2011  50 30 20 1 40
          2012  67  0 33 1 34
          2013  75 26  0 1 51
          2014  75  3 22 1 39
          2015  86 14  0 1 50
          2016  88 12  0 1 50
          2017  82  9  9 1 46
          2018  79  7 14 1 43
          end
          format %ty Year
          Last edited by Sara Bruene; 28 Oct 2022, 17:26.

          Comment

          Working...
          X