Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65052

Line plot with event markers

$
0
0
I have daily stock price data for many different companies.
For each company, there is at least one "event" date that I am interested in.
I would like to create a line plot for a given company (group_id), that has a marker only on the event date(s).

So far the only solutions I found were:
  1. I defined a binary event variable (equal to 1 for an event, and 0 otherwise) and used it as a weight, which leads to a huge circle around the event datapoint. It is almost impossible to identify the exact point it is circling.
    Code:
    scatter price date [w=event] if group_id == 1, msymbol(Oh) connect(l)
  2. I defined the event variable to equal "event" for an event, and "" otherwise, and used it as a label, which is also hard to pinpoint when looking at over a year of data.
    Code:
    scatter price date if group_id == 1, mlabel(event) msymbol(none) connect(l)
Optimally, I would like a small dot/circle on event datapoints.

Please let me know if this is feasible.

Thank you so much!

Viewing all articles
Browse latest Browse all 65052

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>