One option is to do some math to figure out the equation of your line and use a LINEPARM statement.
https://documentation.sas.com/?docsetId=grstatproc&docsetVersion=9.4&docsetTarget=n1h6n82pw2uqo6n10a...
Or add it in as second set of data in new variables and use a SERIES statement with GROUP to get the dots connected.
That's probably the easiest way. If you can provide raw data used to generate that graph and your current code someone can help with the code.
Here are instructions on how to provide sample data as a data step:
https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...
@jamie2 wrote:
Using SAS 9.4, I employ SGPLOT to produce two SCATTERs on the same output: one plotting subject values on YAXIS (blue), the other plotting the same set of subjects values on Y2AXIS (red).
I want to draw a line (purple) from a particular subject’s values on one box to their value on the other box.
Can you point me in the right direction?
Pun intended.
I imagine that I need to transform the Y2 values so that they map to Y1 values and then draw lines using SGANNO as if the Y2 axis does not exist....