What would be the procedure equivalent to proc transreg for ANOVAS (categorical IV's)? We are looking to use boxcox transformations on a continuous DV.
The documentation for the TRANSREG section on the Box-Cox transformation says,
"This family of transformations of the positive [emphasis added] dependent variable y is controlled by the parameter ...."
It also states that you can "specify the PARAMETER=c transformation option when you want to shift the values of y, usually to avoid negatives." So when DV=0, you can to get rid of the error and apply the BC transformation by adding any positve value, such as the following (which adds 1):
proc transreg data=Have;
model BoxCox(DV / lambda=1 parameter=1) = class(cat);
run;
Hello @ANKH1,
Your question requires more details before experts can help. Can you revise your question to include more information?
Review this checklist:
To edit your original message, select the "blue gear" icon at the top of the message and select Edit Message. From there you can adjust the title and add more details to the body of the message. Or, simply reply to this message with any additional information you can supply.
SAS experts are eager to help -- help them by providing as much detail as you can.
This prewritten response was triggered for you by fellow SAS Support Communities member @PGStats
.
@ANKH1 wrote:
What would be the procedure equivalent to proc transreg for ANOVAS (categorical IV's)? We are looking to use boxcox transformations on a continuous DV.
You would want to use the CLASS transformation of the MODEL statement.
Are you sure that the error is not because you have negative values of DV?
Please show us a portion of your data set SAMPLE1, following these instructions: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...
Hi,
Thank you for your answer.
We don't have negative values in that DV. I tried following the code you provided to show our data but I guess I couldn't figured out how since our data set is an imported excel file with approx 19900 rows and 80 columns.
I tried the code with another DV to see if it could be another reason, but again it showed an error for one value. I checked for that DV and that one value seems to be again coming from only one value = 0.
As an experiment, run the PROC TRANSREG on a data set which doesn't have 0 values for Y using
model boxcox(DV/lambda=1)=class(IV);
and see if the error goes away.
It did run!
@ANKH1 wrote:
Hi,
Thank you for your answer.
We don't have negative values in that DV. I tried following the code you provided to show our data but I guess I couldn't figured out how since our data set is an imported excel file with approx 19900 rows and 80 columns.
I tried the code with another DV to see if it could be another reason, but again it showed an error for one value. I checked for that DV and that one value seems to be again coming from only one value = 0.
How exactly did you check for negative values? Since you say that you "imported" and Excel file there are times when, depending on the display settings in Excel very small magnitude negative value, such as -0.000001, could appear as 0.00 with the default 2 decimals in Excel and Proc Import might honor that setting or just not show if the value has a BEST format associated.
Consider:
data example; x= -0.00001; format x best4.; put x= ; run;
The log will show x=0. As would a table view or proc print.
This may be a long shot but "mystery" behaviors sometimes require examining the less common issues.
That's an interesting thought.
This implies that @ANKH1 ought to do something like
proc print data=sample1(where=(dv<0));
Or use PROC MEANS to examine the minimum:
proc means data=sample1 fw=18 macdec=16;
var dv;
run;
Hi,
I ran the code and didn't get any negative values.
So, that's not it, but I don't really have any other suggestions about what might be causing this. I would still contact SAS Tech support to see if they have an explanation.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.