BookmarkSubscribeRSS Feed
SureshPadwal
Fluorite | Level 6

Hi,

I’m trying to transform variable using box-cox transformation for normality.

This variable is combination of negative, positive and missing values.

My SAS code:

proc transreg data=data ss2 details  plots=(transformation(dependent) scatter

                       observedbypredicted);

model BoxCox(change_tc_wk12 / lambda=-2 -1 -0.5 to 0.5 by 0.05 1 2

                       alpha=0.01) =  identity(x);run;

Log error message:

ERROR: 273 invalid values were encountered while attempting to transform variable change_tc_wk12.

WARNING: Ordinary missing values were found or an UNTIE transformation or the UNTIE= option was specified.  The utility of the

         hypothesis tests are dubious since one parameter must be estimated for each of these values.  If you really want to

         do this, ensure that no observations are duplicated -- combine duplicate observations and use a FREQ statement.  If

         you do not, the parameter count may be too large and the tests overly conservative. However, it is best to avoid

         this situation altogether.

NOTE: Plot requests DEPENDENTS SCATTER OBSERVEDBYPREDICTED are ignored.

NOTE: The SAS System stopped processing this step because of errors.

While same code works for another variable containing positive values.

Also is there any procedure to identify possible transformation for particular non normal variable similar to ‘ladder’ command in STATA software which provides all possible transformations.

Please help.

1 REPLY 1
Someone1
Calcite | Level 5

Try to remove 0 (or lower than 0 ) from the dataset.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

Discussion stats
  • 1 reply
  • 5937 views
  • 1 like
  • 2 in conversation