Hello, I have an original data set that looks like this: Thus far I've created a scatter plot using this code: proc sgplot data=W2.earthquakes(where=(year >= 2000));
XAXIS type = discrete;
Scatter X = year Y = magnitude;
Title 'Magnitude of Earthquakes occuring in 2000 and beyond';
run; And I get a graph that looks like this: I want to overlay the mean magnitude for each year on the same graph in a red line. I also want to incorporate reference lines that indicate different levels of earthquakes. These reference lines would be light, moderate, strong, major, and great earthquakes and they would be defined at magnitudes of 4.0, 5.0, 6.0, 7.0, and 8.0. The ideal final output would look like the graph above but with the mean line and the additional reference lines running through it. I'm at a loss of how to do calculate the average within the sgplot proc. Do I need a create a new dataset with the average as a variable? Would it be possible to incorporate proc means within proc sgplot? Thank you!
... View more