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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1120 views
  • 0 likes
  • 2 in conversation