BookmarkSubscribeRSS Feed
Pritish
Quartz | Level 8

Hi,

I am trying to calculate the z-score for the variable that I have in my dataset using proc standard. All the columns have different mean and std, so my question is should I use a common mean and std deviation for calculating the z-score or I should calculate it separately?

in terms of code:

PROC STANDARD

      DATA = X

     MEAN = 0

     STD = 1

     OUT = ZSCORE

     VAR

     A /* it has a mean of 5 and std of 5 */

     B /* it has a mean of 500 and std of 7 */

     C /* it has a mean of 900 and std of 1000 */

run;

OR I should use this approach?

PROC STANDARD

      DATA = X

     MEAN = 5

     STD = 5

     OUT = ZSCORE_a

     VAR

     A /* it has a mean of 5 and std of 5 */

  run;

PROC STANDARD

      DATA = X

     MEAN = 500

     STD = 7

     OUT = ZSCORE_b

     VAR

          B /* it has a mean of 500 and std of 7 */

      run;

PROC STANDARD

      DATA = X

     MEAN = 900

     STD = 1000

     OUT = ZSCORE_c

     VAR

         C /* it has a mean of 900 and std of 1000 */

run;

and then merge all cols

I really appreciate your time and guidance.

Thanks!

1 REPLY 1
SteveDenham
Jade | Level 19

See my reply in the Statistical Procedures forum.  The first code block is what you want to use.

Steve Denham

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 591 views
  • 0 likes
  • 2 in conversation