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

Could I get some help on how to create centered values of variables in a dataset? In the attached example I'd like to calculate the grand mean for score1 and score2 and then subtract each value of score1 and score2 from their corresponding grand mean. I need to do this on a grand scale for many variables so I suppose it's an exercise in how to merge the raw data with the grand means of each variable. Or, is there a statistical procedure that can do it?

Thanks!!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

There's a proc for that :-), Look up proc standardize and stdize

Edit: in your case you want stdize with method= mean.

View solution in original post

3 REPLIES 3
KachiM
Rhodochrosite | Level 12

This can be easily done using double do-loops. No procedure is needed. It is just adding the values of the variable with simultaneous count in the first do-loop and finding the deviations

from the mean in the second do-loop.

I am unable to read your attached data set because of version difference. If you are interested, show a sample data in a readable form like datalines.

Best of luck.

Muthia Kachirayan

Reeza
Super User

There's a proc for that :-), Look up proc standardize and stdize

Edit: in your case you want stdize with method= mean.

PTD_SAS
Obsidian | Level 7

Thank you Reeza, saved me a lot of time!

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
  • 3 replies
  • 6063 views
  • 3 likes
  • 3 in conversation