Announcement

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

  • Twoway Scatter- option to display number of datapoints being used to generate graph

    Hello,
    i was working on generating a simple two way scatter graph
    Code:
    twoway scatter y x
    and was looking for the option of displaying certain graph metadata like "Number of data points" (because points can often overlap so hard to visually gauge)..is that something that can happen in stata ?

  • #2
    Hi Sakshi, how many observations do you have in your data set? Because sometimes STATA doesn't plot visual representations if data points are too few.

    Comment


    • #3
      Here is a minimal example of what you can do:

      Code:
      . sysuse auto, clear
      (1978 automobile data)
      
      . count if !missing(mpg, weight)
        74
      
      . local N = r(N)
      
      . scatter mpg weight, note({it:n} = 74)
      For the same kind of idea carried further, see e.g. https://www.statalist.org/forums/for...updated-on-ssc

      Comment

      Working...
      X