BookmarkSubscribeRSS Feed
EpiMoby
Calcite | Level 5

I have a set of county-level indicators that I am trying to robustly scale for comparability across regression models. I've tried many things but can't seem to find the code to do this. 

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Please explain what you mean by "robustly scale for comparability across regression models". Why would scaling even matter in Regression? If you have variables temperature and distance, it doesn't matter if temperature is Fahrenheit or Celsius; and it doesn't matter if distance is kilometers or 1/16 of an inch, you will get the same predicted values and the same goodness of fit either way.

--
Paige Miller
EpiMoby
Calcite | Level 5

For comparability across regression models, I need to robustly scale each variable by centering
at the median value among all counties and then standardized to the median of the absolute deviation of
all counties. I'm doing this so 1 standard deviation means the same for all variables. I can do this in R, but am trying to replicate in SAS. The code I'm using is 

 

proc stdize data = dataset out = scalesample method=median;

var variable;

run; 

PaigeMiller
Diamond | Level 26

Seems like you want to use PROC STDIZE with the option METHOD=MAD

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_stdize_syntax01.htm#statug.stdi...

--
Paige Miller

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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