Announcement

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

  • Spagplot

    I have created a spaghetti plot in Stata, but I am puzzled by the vertical lines at the baseline. Do you have any idea what might be going wrong? The issue is not due to a baseline participant being recorded twice (which could explain it).




    Click image for larger version

Name:	Spag.png
Views:	1
Size:	40.3 KB
ID:	1752526

  • #2

    Let's assume that the variables are y and t and that you also have an identifier id

    Code:
    scatter y t , by(id) 
    should give the individuals' data.

    Comment


    • #3
      my guess is different from @Nick Cox's; you don't show your code (which you should do - please read the FAQ), but my guess is that you are connecting the lines inappropriately; please follow the advice in the FAQ and provide (1) a data example using -dataex- and posted in CODE blocks and (2) show the exact code you used to get the graphs

      Comment


      • #4
        #2 and #3 aren't contradictory. It could be that you have incomplete histories for some people (?) which are being connected spuriously.

        Comment

        Working...
        X