BookmarkSubscribeRSS Feed
Doc_Duke
Rhodochrosite | Level 12
Hi,

I'm stumped. I am looking for a point-and-click (EGuide) way to compute the area under a curve, where each point on the curve is on a separate record. Each record has ID, Time, Assay and I want to use the trapezoid rule to compute the area under the curve that you draw if you connect the time-assay dots within each ID [ 1/2(Assay(Time k)-Assay(Time k-1))*( (time k) - (time k-1) ) ]. This is relatively straightforward to do in a DATA step with the data sorted on ID and Time (using the LAG and RETAIN functionality of the DATA step). Anyone know how I can do it using the tasks available in EGuide?

[I have a researcher who wanted to summarize her data this way; she only knows the point-n-click interface of EGuide. I'd rather show how to do this building on the tools she already knows than having the pain of learning to code.]

Thanks,
Doc Muhlbaier
Duke
1 REPLY 1
RichardH_sas
SAS Employee
Hi Doc,

I can't think of an easy way to do this in EG. You could do two separate transposes to get your time varaibles in a row and your assay variables in a row then join them... but then you'd have to compute each area difference with a separate variable, yuck.

I was trying some stuff with a self-join of the initial table to itself, but the best I could do was all possible rows in which time_j > time_k. You'd really rather time_j = time_j+1.

So... my best suggestion now would be to write some code for her, add some appropriate parameters, and show her how to run the project to get what she needs. The reason it's so hard to take the point and click approach is that EG Filter and Query is PROC SQL behind the scenes, and PROC SQL is not designed to give you the row-level control you're describing here.

Sorry I don't have a better answer!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 687 views
  • 0 likes
  • 2 in conversation