The TRANSREG Procedure

Example 119.2 Box-Cox Transformations

(View the complete code for this example.)

This example shows Box-Cox transformations with a yarn failure data set. For more information about Box-Cox transformations, including using a Box-Cox transformation in a model with no independent variable, to normalize the distribution of the data, see the section Box-Cox Transformations. In this example, a simple design was used to study the effects of different factors on the failure of a yarn manufacturing process. The design factors are as follows:

  • the length of test specimens of yarn, with levels of 250, 300, and 350 mm

  • the amplitude of the loading cycle, with levels of 8, 9, and 10 mmd

  • the load with levels of 40, 45, and 50 grams

The measured response was time (in cycles) until failure. However, you could just as well have measured the inverse of time until failure (in other words, the failure rate). Hence, the correct metric with which to analyze the response is not apparent. You can use PROC TRANSREG to find an optimum power transformation for the analysis. The following statements create the input SAS data set:

title 'Yarn Strength';

proc format;
   value a -1 =   8 0 =   9 1 =  10;
   value l -1 = 250 0 = 300 1 = 350;
   value o -1 =  40 0 =  45 1 =  50;
run;

data yarn;
   input Fail Amplitude Length Load @@;
   format amplitude a. length l. load o.;
   label fail = 'Time in Cycles until Failure';
   datalines;
 674 -1 -1 -1    370 -1 -1  0    292 -1 -1  1    338  0 -1 -1
 266  0 -1  0    210  0 -1  1    170  1 -1 -1    118  1 -1  0
  90  1 -1  1   1414 -1  0 -1   1198 -1  0  0    634 -1  0  1
1022  0  0 -1    620  0  0  0    438  0  0  1    442  1  0 -1
 332  1  0  0    220  1  0  1   3636 -1  1 -1   3184 -1  1  0
2000 -1  1  1   1568  0  1 -1   1070  0  1  0    566  0  1  1
1140  1  1 -1    884  1  1  0    360  1  1  1
;

PROC TRANSREG is run to find the Box-Cox transformation. The lambda list is –2 TO 2 BY 0.05, which produces 81 lambdas, and a convenient lambda is requested. This many power parameters makes a nice graphical display with plenty of detail around the confidence interval. In the interest of space, only part of this table is displayed. The independent variables are designated with the QPOINT expansion. QPOINT, for quadratic point model, gets its name from PROC TRANSREG’s ideal point modeling capabilities, which process variables for a response surface analysis. What QPOINT does is create a set of independent variables consisting of the following: the m original variables (Length Amplitude Load), the m original variables squared (Length_2 Amplitude_2 Load_2), and the pairs of products between the m variables (LengthAmplitude LengthLoad AmplitudeLoad). The following statements produce Output 119.2.1:

ods graphics on;

proc transreg details data=yarn ss2
              plots=(transformation(dependent) obp);
   model BoxCox(fail / convenient lambda=-2 to 2 by 0.05) =
         qpoint(length amplitude load);
run;

Output 119.2.1: Box-Cox Yarn Data

Box-Cox Yarn Data



Dependent Variable BoxCox(Fail)
Time in Cycles until Failure

Number of Observations Read27
Number of Observations Used27

Model Statement Specification Details
TypeDFVariableDescriptionValue
Dep1BoxCox(Fail)Lambda Used0
   Lambda-0.2
   Log Likelihood-125.9
   Conv. Lambda0
   Conv. Lambda LL-126.7
   CI Limit-127.8
   Alpha0.05
   OptionsConvenient Lambda Used
   LabelTime in Cycles until Failure
Ind1Qpoint.LengthDF1
Ind1Qpoint.AmplitudeDF1
Ind1Qpoint.LoadDF1
Ind1Qpoint.Length_2DF1
Ind1Qpoint.Amplitude_2DF1
Ind1Qpoint.Load_2DF1
Ind1Qpoint.LengthAmplitudeDF1
Ind1Qpoint.LengthLoadDF1
Ind1Qpoint.AmplitudeLoadDF1


The TRANSREG Procedure Hypothesis Tests for BoxCox(Fail)
Time in Cycles until Failure

Univariate ANOVA Table Based on the Usual Degrees of Freedom
SourceDFSum of SquaresMean SquareF ValueLiberal p
Model922.564982.50722066.73>= <.0001
Error170.638710.037571  
Corrected Total2623.20369   
The above statistics are not adjusted for the fact that the dependent variable was transformed and so are generally liberal.

Root MSE0.19383R-Square0.9725
Dependent Mean6.33466Adj R-Sq0.9579
Coeff Var3.05987Lambda0.0000

Univariate Regression Table Based on the Usual Degrees of Freedom
VariableDFCoefficientType II
Sum of
Squares
Mean SquareF ValueLiberal pLabel
Intercept16.4206207159.008159.0084232.19>= <.0001Intercept
Qpoint.Length10.832384212.47212.472331.94>= <.0001Length
Qpoint.Amplitude1-0.63099167.1677.167190.75>= <.0001Amplitude
Qpoint.Load1-0.39249402.7732.77373.80>= <.0001Load
Qpoint.Length_21-0.08569740.0440.0441.17>= 0.2939Length_2
Qpoint.Amplitude_210.02421830.0040.0040.09>= 0.7633Amplitude_2
Qpoint.Load_21-0.06745550.0270.0270.73>= 0.4058Load_2
Qpoint.LengthAmplitude1-0.03824140.0180.0180.47>= 0.5035LengthAmplitude
Qpoint.LengthLoad1-0.06841460.0560.0561.49>= 0.2381LengthLoad
Qpoint.AmplitudeLoad1-0.02083400.0050.0050.14>= 0.7142AmplitudeLoad

The above statistics are not adjusted for the fact that the dependent variable was transformed and so are generally liberal.


trge2c
External File:images/trge2c1.png

The optimal power parameter is –0.20, but since 0.0 is in the confidence interval, and since the CONVENIENT t-option was specified, the procedure chooses a log transformation. The plot shows in the vicinity of the optimal Box-Cox transformation, the parameters for the three original variables (Length Amplitude Load), particularly Length, are significant and the others become essentially zero.