BookmarkSubscribeRSS Feed
CathyVI
Pyrite | Level 9

Hi,

I will like to correlate continous variable A which has a panel of risk factors e.g. BMI, BP, totchol  using a

z-score approach in sas. First I want to transfer each variable to a common scale using a normal (z-score) tranformation where the variable has a mean=0 and SD=1. Then once i transform each variable, i will like to combine then into a single composite variable by adding the tranformed values together. Then i will like to evaluate if A is associated with the single composite variable adjusting for C (age) using regression.

This is a demo data i created

data test;

input A $ BP $ totchol $ BMI $ age $;

datalines;

 

1.222 127 132 22.4 34

1.332 123 133 22.3 44

1.443 234 244 34.2 23

2.344 344 241 54.2 65

3.122 543 234 23.1 44

5.234 353 354 25.5 78

4.344 533 123 45.6 23

2.645 334 234 45.3 16

;

run;

 

 

1 REPLY 1
Ksharp
Super User
data test;
input A  BP  totchol  BMI  age ;
datalines;
1.222 127 132 22.4 34
1.332 123 133 22.3 44
1.443 234 244 34.2 23
2.344 344 241 54.2 65
3.122 543 234 23.1 44
5.234 353 354 25.5 78
4.344 533 123 45.6 23
2.645 334 234 45.3 16
;
run;

proc stdize data=test out=want;
var _numeric_;
run;

proc means data=want mean std;
var _numeric_;
run;

Like this ?

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!

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
  • 1 reply
  • 1422 views
  • 0 likes
  • 2 in conversation