Hello all,
I have a project for a class that asks me to do 3 things
I have completed all of the tasks correctly, except computing Tmax .
For this part of my project I have:
data temp3;
set project2_transposed;
array conc[13] C1-C13;
Cmax= max(of conc{*});
array times[13] T1-T13;
Tmax= max(of times(of Cmax);
by subject;
run;
proc print data= temp3;
title "Part3";
run;
I know Tmax is the maximum time from the point where the Concentration is highest. So I thought it would be Tmax = time of Cmax.
Again, Cmax is correct, and I do not get any errors in my log. However, the output numbers from Tmax are incorrect. If anyone could offer any advice I would be grateful.
Thank you,
Mackenzie
Hint: look at function WHICHN()
@mackenzies3 wrote:
Hello all,
I have a project for a class that asks me to do 3 things
- Use PROC TRANSPOSE to restructure the converted SAS data set as described in the Word document
- Using ARRAY statement to compute the Cmax and Tmax
- For each patient, compute the following: MEAN of the concentration values and MINIMUM of the concentration values.
I have completed all of the tasks correctly, except computing Tmax .
For this part of my project I have:
data temp3;
set project2_transposed;
array conc[13] C1-C13;
Cmax= max(of conc{*});
array times[13] T1-T13;
Tmax= max(of times(of Cmax);
by subject;
run;
proc print data= temp3;
title "Part3";
run;
I know Tmax is the maximum time from the point where the Concentration is highest. So I thought it would be Tmax = time of Cmax.
Again, Cmax is correct, and I do not get any errors in my log. However, the output numbers from Tmax are incorrect. If anyone could offer any advice I would be grateful.
Thank you,
Mackenzie
Learn about it in SAS documentation. All users, experienced or not, look at it every day.
Good thinking so far. Since the conc and times arrays correspond elementwise, what you are looking for is the position of cmax in array conc in order to return the corresponding element from array times. Finding the position of cmax in array conc is what WHICHN can do...
@PGStats It looks like this forum is more and more about home work. Maybe we're nearing end-of-term / end-of year.
I hope the teachers are wise enough to check the forum.
It's an online graduate course so we don't have access to traditional teaching settings or in-person help. It's harder to learn solely based on online lectures. The internet is an important tool to help us truly understand.
I'm not the internet! I'm a real person.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.