The TRANSREG Procedure

Example 119.1 Transformation Regression of Exhaust Emissions Data

(View the complete code for this example.)

In this example, the data are from an experiment in which nitrogen oxide emissions from a single cylinder engine are measured for various combinations of fuel, compression ratio, and equivalence ratio. The data are provided by Brinkman (1981). This gas data set is available from the Sashelp library.

The equivalence ratio and nitrogen oxide variables are continuous and numeric, so spline transformations of these variables are requested. The spline transformation of the dependent variable is restricted to be monotonic. Each spline is degree three with nine knots (one at each decile) in order to give PROC TRANSREG a great deal of freedom in finding transformations. The compression ratio variable has only five discrete values, so an optimal scoring is requested with monotonicity constraints. The character variable Fuel is nominal, so it is optimally scored without any monotonicity constraints. Observations with missing values are excluded with the NOMISS a-option.

ods graphics on;

title 'Gasoline Example';
title2 'Iteratively Estimate NOx, CpRatio, EqRatio, and Fuel';

* Fit the Nonparametric Model;
proc transreg data=sashelp.Gas solve test nomiss plots=all;
   ods exclude where=(_path_ ? 'MV');
   model mspline(NOx / nknots=9) = spline(EqRatio / nknots=9)
                                   monotone(CpRatio) opscore(Fuel);
run;

Output 119.1.1: Transformation Regression Example: The Nonparametric Model

Gasoline Example
Iteratively Estimate NOx, CpRatio, EqRatio, and Fuel

The TRANSREG Procedure


Dependent Variable Mspline(NOx)
Nitrogen Oxide

Number of Observations Read171
Number of Observations Used169

TRANSREG MORALS Algorithm Iteration History for Mspline(NOx)
Iteration
Number
Average
Change
Maximum
Change
R-SquareCriterion
Change
Note
00.419003.805500.05241  
10.119840.833270.910280.85787 
20.037270.176880.939810.02953 
30.027950.108800.949690.00987 
40.020880.072790.953820.00413 
50.015300.050310.955820.00201 
60.011300.039220.956880.00106 
70.008520.031970.957480.00060 
80.006570.025310.957830.00035 
90.005100.019750.958050.00022 
100.003980.015340.958180.00013 
110.003140.012000.958270.00009 
120.002500.009530.958320.00005 
130.001990.007520.958360.00003 
140.001590.005940.958380.00002 
150.001270.004700.958390.00001 
160.001020.003730.958400.00001 
170.000810.002970.958410.00001 
180.000650.002370.958410.00000 
190.000520.001890.958410.00000 
200.000420.001510.958420.00000 
210.000330.001200.958420.00000 
220.000270.000960.958420.00000 
230.000210.000770.958420.00000 
240.000170.000610.958420.00000 
250.000140.000490.958420.00000 
260.000110.000390.958420.00000 
270.000090.000310.958420.00000 
280.000070.000250.958420.00000 
290.000060.000200.958420.00000 
300.000050.000160.958420.00000Not Converged

WARNING: Failed to converge, however criterion change is less than 0.0001.


The TRANSREG Procedure Hypothesis Tests for Mspline(NOx)
Nitrogen Oxide

Univariate ANOVA Table Based on the Usual Degrees of Freedom
SourceDFSum of SquaresMean SquareF ValueLiberal p
Model21326.017615.52465161.35>= <.0001
Error14714.14430.09622  
Corrected Total168340.1619   
The above statistics are not adjusted for the fact that the dependent variable was transformed and so are generally liberal.

Root MSE0.31019R-Square0.9584
Dependent Mean2.34593Adj R-Sq0.9525
Coeff Var13.22262  


trge1b
External File:images/trge1b1.png
External File:images/trge1b2.png

The squared multiple correlation for the initial model is approximately 0.05. PROC TRANSREG increases the R square to over 0.95 by transforming the variables. The transformation plots show how each variable is transformed. The transformation of compression ratio (TCpRatio) is nearly linear. The transformation of equivalence ratio (TEqRatio) is nearly parabolic. It can be seen from this plot that the optimal transformation of equivalence ratio is nearly uncorrelated with the original scoring. This suggests that the large increase in R square is due to this transformation. The transformation of nitrogen oxide (TNOx) is similar to a log transformation. The final plot shows the transformed dependent variable plotted as a function of the predicted values. This plot is reasonably linear, showing that the nonlinearities in the data are being accounted for fairly well by the TRANSREG model.

These results suggest the parametric model

You can perform this analysis with PROC TRANSREG. The following statements produce Output 119.1.2:

title2 'Now fit log(NOx) = b0 + b1*EqRatio + b2*EqRatio**2 +';
title3 'b3*CpRatio + Sum b(j)*Fuel(j) + Error';

*-Fit the Parametric Model Suggested by the Nonparametric Analysis-;
proc transreg data=sashelp.Gas solve ss2 short nomiss plots=all;
   model log(NOx) = pspline(EqRatio / deg=2) identity(CpRatio)
                    opscore(Fuel);
run;

Output 119.1.2: Transformation Regression Example: The Parametric Model

Gasoline Example
Now fit log(NOx) = b0 + b1*EqRatio + b2*EqRatio**2 +
b3*CpRatio + Sum b(j)*Fuel(j) + Error

The TRANSREG Procedure


Dependent Variable Log(NOx)
Nitrogen Oxide

Number of Observations Read171
Number of Observations Used169

Log(NOx)
Algorithm converged.


The TRANSREG Procedure Hypothesis Tests for Log(NOx)
Nitrogen Oxide

Univariate ANOVA Table Based on the Usual Degrees of Freedom
SourceDFSum of SquaresMean SquareF ValuePr > F
Model879.338389.917298213.09<.0001
Error1607.446590.046541  
Corrected Total16886.78498   

Root MSE0.21573R-Square0.9142
Dependent Mean0.63130Adj R-Sq0.9099
Coeff Var34.17294  

Univariate Regression Table Based on the Usual Degrees of Freedom
VariableDFCoefficientType II
Sum of
Squares
Mean SquareF ValuePr > FLabel
Intercept1-15.27464957.133857.13381227.60<.0001Intercept
Pspline.EqRatio_1135.10291462.747862.74781348.22<.0001Equivalence Ratio 1
Pspline.EqRatio_21-19.38646864.643064.64301388.94<.0001Equivalence Ratio 2
Identity(CpRatio)10.0320581.44451.444531.04<.0001Compression Ratio
Opscore(Fuel)50.1583885.56191.112423.90<.0001Fuel


trge1d
External File:images/trge1d1.png
External File:images/trge1d2.png

The LOG transformation computes the natural log. The PSPLINE expansion expands EqRatio into a linear term, EqRatio, and a squared term, . An identity transformation of CpRatio and an optimal scoring of Fuel is requested. These should provide a good parametric operationalization of the optimal transformations. The final model has an R square of 0.91 (smaller than before since the model has fewer parameters, but still quite good).