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
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
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.
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.
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 16. Read more here about why you should contribute and what is in it for you!
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.