BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
_maldini_
Barite | Level 11

What is the correct syntax for the following calculation (see image)?

Screen Shot 2022-07-07 at 3.15.08 PM.png

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
1-0.9144**(exp(60.69-61.18))

EXP or CONSTANT('e') function for e

** for exponential

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Use the EXP() function.

--
Paige Miller
Reeza
Super User
1-0.9144**(exp(60.69-61.18))

EXP or CONSTANT('e') function for e

** for exponential

_maldini_
Barite | Level 11

Whoops. I'm getting an "Invalid argument to function" error. What am I doing wrong here?

Screen Shot 2022-07-08 at 11.33.47 AM.png

Reeza
Super User

The number being generated is too large for a computer to represent. E to those exponents in a regular calculator errors out so something is wrong somewhere in your formulas. Guessing units?

FreelanceReinh
Jade | Level 19

Hello @_maldini_,

 

I suspect that there are two errors in your calculation:

  1. Looking at the source of your formula, the 2013 ACC/AHA Guideline on the Assessment of Cardiovascular Risk, it appears that the "mean" value occurring in the argument of the EXP function is a race- and sex-specific constant based on older studies. This is confirmed by the "Calculation Details and Variables" under the online calculator found in https://www.merckmanuals.com/medical-calculators/ACCAHA2013-ja.htm. Only the "individual sum" term is calculated from individual measurements. The formulas for ind_sum_blk_f and  mean_blk_f in your code, however, show that you calculate both the sum and the mean from the same set of values, which is definitely wrong. According to either of the two sources linked above the relevant mean value (here: for black females) is mean_blk_f=86.61.
  2. I would expect realistic "individual sum" values to be about the same order of magnitude as the constant "mean" values. Note that all continuous measurements (such as cholesterol) are logarithmized in the formula. So, extreme outliers leading to individual sums in the thousands (cf. your 11187, etc.) should be completely impossible and indicate that one or more values used must be "way off," like not logarithmized or having the wrong unit, as Reeza has already suggested.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 2075 views
  • 7 likes
  • 4 in conversation