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

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!

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
  • 656 views
  • 0 likes
  • 2 in conversation