Announcement

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

  • Excluding certain observations from a scatterplot

    Hello all,

    I'd like to drop the observations for "time" > -20 but < -5 and also for time > 5. (I'm only interested in comparing the deviation for the time period between -30 and -20, and also from 5 to -5). Ideally I would not want the observations to be erased from my dataset as I require them again to plot other graphs. Kindly help me generate the codes which can easily accomodate these requirements.

    Thank you.
    Attached Files

  • #2
    Using the if clause on your scatter command will cause the plot to include only the observations you specify.
    Code:
    scatter deviation time if time<=-20 | (time>=-5 & time<=5) , .....
    Do notice that the if clause is not an "option" (even though it is not required, and thus in some sense "optional"), and it comes before, not after, the comma that separates the command from its options.
    Last edited by William Lisowski; 28 Apr 2019, 08:32.

    Comment

    Working...
    X