BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
desireatem
Pyrite | Level 9

Hello Sir/Madam,

 

I have a data set with bmi values and wish to covert it to Z scores. Any help.

 

Best,

DA

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

OUT=<datasetname> on the proc statement creates the output data set. By default the VAR variables are replaced by their scores.

The OPREFIX option indicates whether the original variable is kept and a prefix assigned such as OPREFIX=base would have the original value in the output set named basebmi. You can also specify a prefix for the scored value with SPREFIX, SPREFIX=zscore would have the standardized value as zscorebmi in the output set

 

View solution in original post

3 REPLIES 3
ballardw
Super User

Are you looking to use the mean and standard deviation of your data or do you need to use those from another source?

 

If internal to the data you could use proc stdize which will replace the variable with the standardized value in an output set. The default method is STD which produces z-scores.

desireatem
Pyrite | Level 9

I plan to use its std and mean. so I can use

 

proc stdize data=totalscores method=std pstat;

var total;

by Type;

run;

 

How do I output the z score using above statement? Is the code below correct?

 

proc stdize data=totalscores method=std pstat;

var total;

by Type;

output zscore=zscore;

run;

ballardw
Super User

OUT=<datasetname> on the proc statement creates the output data set. By default the VAR variables are replaced by their scores.

The OPREFIX option indicates whether the original variable is kept and a prefix assigned such as OPREFIX=base would have the original value in the output set named basebmi. You can also specify a prefix for the scored value with SPREFIX, SPREFIX=zscore would have the standardized value as zscorebmi in the output set

 

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
  • 3 replies
  • 1226 views
  • 1 like
  • 2 in conversation