BookmarkSubscribeRSS Feed
Gowthami99
Fluorite | Level 6
I'm completly new to SAS .kindly bear with me ! so here is my question..how can i predict a value of a particular variable based on another variable value. for instace : i have a dataset with variables risk, age and it has values as follows:
Risk Age
12 57
24 67
13 58
56 86
28 59
so on..

So now i need to predict the value of the risk if age increases by 10 years or i can say 'By how much does the risk increase if age increases by ten years?'

any help is highly appreciated.Thank you !!
2 REPLIES 2
Jagadishkatam
Amethyst | Level 16

You can achieve this by simple linear regression from proc reg as below where y = risk and x=age

 

proc reg;

model y = x;

run;

 

proc reg;

model risk=age;

run;

 

then use formula y = mx + c;

 

c= intercept

m=slope

y = mean of risk

x= mean of age

 

image.png

 

Thanks,
Jag

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
  • 2 replies
  • 1301 views
  • 0 likes
  • 3 in conversation