BookmarkSubscribeRSS Feed
sxirasagar
Calcite | Level 5

How to create a computed variable in SAS requiring multiplication by a fixed number? I am creating a new variable called Lifetime colorectal cancer risk that uses cancer occurrences after colonoscopy divided by total person years of observation. There are two segments of lifetime, one is observed follow-up and post followup life expectancy. We use different cancer occurrences and different periods to produce the cancer risk during each of these two periods. The total lifetime risk is the sum of the two risks. For each risk we multiple the cancer rate by mean number of years of observed follow-up in my data, annual total cancer rate multiply by  8.1) and  for post follow-up annual interval cancer rate by 19.3. The reason I need to program this is that I want to generate 95% bootstrapped CI for the lifetime cancer risk. But the SAS code is not recognizing the code EligCRCNew * 8.1. Look forward to your help. Sudha Xirasagar  

5 REPLIES 5
Sam_SAS
SAS Employee

The title of this thread says SAS Visual Analytics, but the actual question seems to be about Base SAS code.

 

Can you clarify which product your question is about?

 

Thanks,

Sam

sxirasagar
Calcite | Level 5

No, as you guessed my question is different. The bar chart selection happened by chance. My question is:

How to create a computed variable in SAS requiring multiplication by a fixed number? I am creating a new variable called Lifetime colorectal cancer risk that uses cancer occurrences after colonoscopy divided by total person years of observation. There are two segments of lifetime, one is observed follow-up and post followup life expectancy. We use different cancer occurrences and different periods to produce the cancer risk during each of these two periods. The total lifetime risk is the sum of the two risks. For each risk we multiple the cancer rate by mean number of years of observed follow-up in my data, annual total cancer rate multiply by  8.1) and  for post follow-up annual interval cancer rate by 19.3. The reason I need to program this is that I want to generate 95% bootstrapped CI for the lifetime cancer risk. But the SAS code is not recognizing the code EligCRCNew * 8.1. Look forward to your help. Sudha Xirasagar  

sxirasagar
Calcite | Level 5

Hi all, any response to my actual question will be appreciated. Thanks, Sudha

ChrisNZ
Tourmaline | Level 20

But the SAS code is not recognizing the code EligCRCNew * 8.1. 

This:

NEWVAR = EligCRCNew * 8.1 ;

is valid code. You have to show us more if you want more help.

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1912 views
  • 0 likes
  • 3 in conversation