Announcement

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

  • plotting missing and non missing data format

    Hello every one,

    I have a panel data set that contains ID , TIME and Price. I want to plot price data in a way that missing data patter can be observable in my graph.

    I need to show the time in X axis and ID (counties name) in Y axis and then draw a graph that show missing pattern.
    I created a Z to be 1 (if price is nonmissing) and 0 (if price is missing) but I could not overlay it on my graph

    As you can see my graph look likes to a grid that each cell should be blue for non missing and red for missing

    I appreciate your help ahead of time.


    Click image for larger version

Name:	Captur1e.PNG
Views:	1
Size:	46.2 KB
ID:	1651801



  • #2
    This reproducible example may help. In this example, nothing is missing but plotting an indicator variable for being above the 90% point is similar in spirit.

    Code:
    webuse grunfeld, clear 
    su invest, detail
    gen toshow = invest > r(p90)
    set scheme s1color
    scatter company year if toshow, xla(1935/1954, ang(v) grid) yla(1/10, ang(h) grid) ysc(reverse)

    Comment


    • #3
      Dear Nick Cox Thank you for you help.
      I was wondering if you any suggestion how to visually I can use stata to show the patter on missingness for each ID in during Period of T to T+n
      I used missingplot however it does not produce the out so that I can analyze the pattern.
      Regrads

      Comment


      • #4
        I think I have answered your question. You just need to apply to your data.

        Comment


        • #5

          Nick Cox Tes, my point is if there is any other package in stata that help to better visualization of data. I am working with huge dataset with 550 IDs for 553 weeks. I used your command it works but because the volume of data output is not clear enough.

          Comment


          • #6
            My fault in #4 was not knowing what you explained in #5. I was guilty!

            What you are asking for is a scatter plot. So, I can't understand that a specific package is needed or would be helpful.

            I can't see the result of plotting 500 or so distinct identifiers on one axis and 500 or so distinct times on the other axis, but I can only fear that the result is a mess and that there isn't another way to do it. Perhaps grouping or sorting the identifiers in some way might help. Also, if some identifiers show no missing values they might be omitted from the plot without loss.

            Comment

            Working...
            X