BookmarkSubscribeRSS Feed
RobertNYC
Obsidian | Level 7

Hi all, 

 

Two questions: 

 

1. Is  there an option in proc REG which will automatically perform log  transform candidate vars?   I have many regression models I have to fit and it will take a long time to transform applying the LOG  function to each variable.  Since I have many vars measured at many different scales I need to  make my parameter estimates easier to interpret.

 

Proc reg data=data  ;
model TARGET =var1 var2 var3... /* Option to Automatically Perform log transformation of all x vars?????*/
/ details vif ;run; quit;

 

2. I know I can output standardized betas using the STB function.  What is the difference in log transformation and STB? 

 

I thank you in advance for any assistance with these questions.  

5 REPLIES 5
SAS_Rob
SAS Employee

No, there is not an option to log transform directly.  The only procedure that will do that directly is Proc TRANSREG.

 

The standardized betas essentially remove the units associated with the independent variables so that a comparison can be made based on the relative magnitude of the standardized estimates.  A log transform would change the scale of the response variable.

novinosrin
Tourmaline | Level 20

This often confuses me as well. Suppose, you standardize using proc stdize or standard, and then run a proc reg using the standardized values, is that some kind of equivalent to stb option?

Sorry if this is lame 

Rick_SAS
SAS Super FREQ

Yes, the standardized betas are equivalent to using PROC STDIZE METHOD-STD and then running a regression on the standardized variables. But be sure that you standardize both the independent and dependent variables. 

 

Although the parameter estimates for the standardized variables will equal the standardized betas for the original variables, scale-dependent statistics such as standard errors and covariance of betas will change.

 

novinosrin
Tourmaline | Level 20

Thank you @Rick_SAS for clarifying. What worries me if I do standardise or in other transform, the units of measure would consequently change.  Would that complicate to re transform before I interpret with another proc or so?

Rick_SAS
SAS Super FREQ

I don't think a linear rescaling should complicate anything for interpreting linear regression models. If you measure data in inches and pounds, you should get the same linear relationship as if you measure in centimeters and kilograms. Only the units change, so of course the parameter estimates have to change to preserve the relationship. When you center the data, the linear relationship also is unchanged, but now you are measuring in "centimeters from 12.75" instead of "centimeters from 0," so the intercept in the model changes. For more information, see my blog post about standardized regression coefficients.

 

One thing that definitely changes is your ability to log-transform the data. You can only log-transform positive data. You cannot log-transform centered data.

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 5288 views
  • 4 likes
  • 4 in conversation