BookmarkSubscribeRSS Feed
uzma03505621
Obsidian | Level 7

I am using Proc transreg to identify which link function will be appropriate for my dependent variable in the GLM model. I used the code as follows:

 

proc transreg data=finalfile;
model boxcox(cost/lambda=-1 to 2 by .5)=identity(&variablelist);
run;

 

 

I get an error
ERROR: 24 invalid values were encountered while attempting to transform variable cost. Is it because my dependent variable has 24 observations with zero costs.

How can I resolve this issue

 

As I changed the code by adding parameter=1

It works giving me the following output and that lamba=0 is selected


The TRANSREG Procedure
TRANSREG Univariate Algorithm Iteration History for BoxCox(cost)
Iteration
Number
Average
Change
Maximum
Change
R-Square Criterion
Change
Note
1 0.00000 0.00000 0.15025   Converged



Algorithm converged.

 

 

 

Please assist me with right method. Thank you

2 REPLIES 2
jiltao
SAS Super FREQ

Your Lambda list includes 0, which is the log transformation. Log of 0 is undefined, and that is why you received that error message.

You might want to exclude these observations, at least for lambda=0.

WarrenKuhfeld
Ammonite | Level 13

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_transreg_details02.htm

 

As you figured out, you can specify PARAMETER= to add a value to each datum to avoid log 0 and other invalid operations. There are many other ways to get nonlinear transformations in TRANSREG and other procedures.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 2 replies
  • 660 views
  • 6 likes
  • 3 in conversation