Announcement

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

  • plotting durations

    Dear community,

    I am trying to visualize some of my data over time and face the following problem: Among other, I have a binary variable polcon indicating whether an entity has a political connection or not and variables containing the start and end date of this political connection (in case there is one).

    I am now seeking a graphical representation over time showing the proportion of connected entities from ~ 1995-2015. The problem is that I have time durations at hand and not mere time points which are convenient to depict. In my case, the entity would need to be regarded as connected, and accordingly represented in a graph, for all the years falling between its start and end date. So far, I have come up with a graph that only takes into account the start date and sort of visualizes for each year how many politically connections have commenced. That's a good start. but the graph is biased downward and fails to indicate the true percentage of politcally connection since each observation is only counted once.

    I am looking forward to your ideas and thoughts!

    Thanks a lot!

    Marie

  • #2
    Please read and act on FAQ Advice #12 and give a data example. One concrete example always captures the imagination in a way that lengthy explanations cannot.

    Otherwise https://journals.sagepub.com/doi/pdf...867X1301300116 may help, as if I understand this you need a different data structure first.

    Comment


    • #3
      Thank you for your promp reply and find below a data example. I am afraid your right, I will need a different data structure first...

      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input long(facilitystartdate facilityenddate) float partly_connected
      18732 20193 1
      15000 15364 0
      20548 22374 0
      15403 17229 0
      19625 21451 1
      16498 17227 0
      16048 16413 1
          .     . 0
      17713 18808 0
      13940 16862 0
      end
      format %d facilitystartdate
      format %d facilityenddate
      Kind regards,

      Marie

      Comment


      • #4
        Hello Nick,

        you have helped me a lot! Your Stata Tip really did the job! Thank you so much!

        Kind regards

        Marie

        Comment


        • #5
          Just one last technical problem: After having edited the graph I tried to save it but stata refuses to store it on my disk. Has it happened to someone else before? I used the "stack" option among other; could that be the problem?

          Comment


          • #6
            Alright, I solved the problem by simply saving it via the save graph filename command.

            Comment

            Working...
            X