BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
VijayM
Calcite | Level 5

Hi,

I am trying to find a way to identify value of a point on curve intersected by line from x-axis. I am trying to overlay a series plot and needle plot. I know the value on x-axis for needle plot but would like to know corresponding value ( at the intersection point on seriesplot) on the curve and would like to display or extend the needle to that point ( i am uanble to figure out how to use TIP). I am using proc template with GTL code.

Any help is appreciated.

Thanks.

Vijay

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

Not sure what you mean by "Dynamic".  Assuming you are not using the SMOOTHCONNECT option, the (x, y) points on a SERIESPLOT are connected with a straight line segments.  Assuming your data is sorted by the x variable, you can find the two points on the series that straddle the needle x-axis value.  Then, you can compute the y coordinate with a linear interpolation.  You could use a DROPLINE statement to create a "needle" from the intersection point to the x-axis.

View solution in original post

4 REPLIES 4
Jay54
Meteorite | Level 14

Not sure what you mean by "Dynamic".  Assuming you are not using the SMOOTHCONNECT option, the (x, y) points on a SERIESPLOT are connected with a straight line segments.  Assuming your data is sorted by the x variable, you can find the two points on the series that straddle the needle x-axis value.  Then, you can compute the y coordinate with a linear interpolation.  You could use a DROPLINE statement to create a "needle" from the intersection point to the x-axis.

VijayM
Calcite | Level 5

Thanks Sanjay for your quick response. I can give bit more details. I am plotting Hemoglin values versus drug exposure duration. I would like to check value of hemoglobin at a specific timepoint ( hemoglobin may not be collected at this point).

But this is an event date and i would like to see what would be hemoglobin value this this event time ( and draw needle from x-axis to this point).

Thanks.

Vijay

ballardw
Super User

Is it appropriate to assume a linear interpolation between actual measurement times? If not you may want to look at a modeling procedure as the results would yeild an equation amenable to such graphing by building a display set.


VijayM
Calcite | Level 5

Thanks both for response. I have used PROC TRANSREG to get the value for specific timepoint on x-axis. I got the answer i was looking for.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1050 views
  • 0 likes
  • 3 in conversation