20 May 2013

# Examples in SPSS and SAS for oil palm fertilizer experimental design and analysis - Part B

This section continues from Part A which discusses Example 2 on pages 267-268 of the publication Oil Palm: Management for Large and Sustainable Yields.

B1 Example 4 (page 271)

Data file for SPSS and SAS

The contents of the data file (contained in a *.dat format) is given below showing (from left to right) the plotnumber (plot), applied level of N (n), applied level of P (p), yield (yield), and block number (block )

 Plot number (plotnr) Applied level of N (n) Applied level of P (p) Yield Block number (block) 21 0 0 73.60 2 33 0 0 79.90 3 26 0 0 80.00 3 16 0 0 75.20 2 6 0 1 93.80 1 19 0 1 87.00 2 15 0 1 86.90 2 12 0 1 95.70 1 29 0 2 92.00 3 5 0 2 93.70 1 3 0 2 94.60 1 30 0 2 88.10 3 28 1 0 84.00 3 4 1 0 90.00 1 2 1 0 88.50 1 32 1 0 87.50 3 20 1 1 88.90 2 34 1 1 98.30 3 36 1 1 98.60 3 14 1 1 88.50 2 10 1 2 97.00 1 24 1 2 86.50 2 13 1 2 90.90 2 11 1 2 95.50 1 7 2 0 90.90 1 18 2 0 79.00 2 23 2 0 83.60 2 8 2 0 89.40 1 27 2 1 95.40 3 1 2 1 100.40 1 9 2 1 97.50 1 31 2 1 95.90 3 22 2 2 88.20 2 35 2 2 92.10 3 25 2 2 96.30 3 17 2 2 88.20 2

B2 Analysis with SPSS

The command file for SPSS is (*.sps) is as follows.

 COMPUTE n1 = n * 2 . EXECUTE . COMPUTE p1 = p * 2 . EXECUTE . COMPUTE n2 = n1 * n1 . EXECUTE . COMPUTE p2 = p1 * p1 . EXECUTE . COMPUTE n1p1 = n1 * p1 . EXECUTE . COMPUTE b1 = 0 . EXECUTE . COMPUTE b2 = 0 . EXECUTE . COMPUTE b3 = 0 . EXECUTE . IF (block = 1) b1 = 1 . EXECUTE . IF (block = 2) b2 = 1 . EXECUTE . IF (block = 3) b3 = 1 . EXECUTE . REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI BCOV R ANOVA /CRITERIA=PIN(.05) POUT(.10) CIN(95) /NOORIGIN /DEPENDENT yield /METHOD=ENTER b1 b2 n1 p1 n2 p2 n1p1 /SAVE PRED MCIN RESID .

B3 Output with SPSS

The output of this SPSS program provides the following information:

- Multiple R 0.97366

- R Square 0.94802

- Standard Error 1.68051

Analysis of Variance:
 Degrees of Freedom Sums of Squares Mean Square Regression 7 1442.18476 206.02639 Residual 28 79.07524 2.82412

F = 72.95253; Signif F = 0.0000

 Variable B Std. Error B 95% C.I. B T Sig T B1 2.780952 0.721884 1.302240 4.259665 3.852 0.0006 B2 -5.966667 0.686066 -7.372008 -4.561325 -8.697 0.0000 N1 3.760714 0.657923 2.413020 5.108409 5.716 0.0000 P1 8.787798 0.657923 7.440103 10.135492 13.357 0.0000 N2 -0.531250 0.148538 -0.835515 -0.226985 -3.577 0.0013 P2 -1.553125 0.148538 -1.857390 -1.248860 -10.456 0.0000 N1P1 -0.230357 0.112284 -0.460360 -3.54136E-04 -2.052 0.0497 (Const.) 80.548810 0.830192 78.848238 82.249381 97.024 0.0000

B4 Calculation of eigenvalues and stationary point with SPSS

These commands cannot be given by clicking in the menus, but must be typed in the Syntax window.

 MATRIX. COMPUTE B= {3.760714 ; 8.787798} . COMPUTE A= {-0.531250 , -0.1151785 ; -0.1151785 , -1.553125 }. COMPUTE STAT_P= - INV(A) * B/2 . PRINT STAT_P . COMPUTE EIGVALS= EVAL(A) . PRINT EIGVALS . END MATRIX.

The corresponding SAS command file (*.sas) contains the following code, where the data file is called: "quadr_ex.dat":

 data; infile 'c:\quadr_ex.dat'; input plotnr n yield; n1 = n . n2 = n * n; run; proc print; run; proc reg; model yield= n1 n2 /p i clm ; run;

B5 Output for calculation of eigenvalues and stationary point with SPSS

The output of these SPSS commands is:

 Run MATRIX procedure: STAT_P 2.973950337 2.608524015 EIGVALS -.518428762 -1.565946238 ------ END MATRIX -----

B6 Analysis with SAS

Assumed is that the data are in the file “ exam_np.dat ” .

 data; infile 'c:\ppi\exam_np.dat'; input plot n p yield block; n1= 2*n ; p1= 2*p; n2=n1*n1; p2=p1*p1; n1p1=n1*p1; if block =1 then b1=1; else b1=0; if block =2 then b2=1; else b2=0; if block =3 then b3=1; else b3=0; run; proc print ; run; proc rsreg; model yield = b1 b2 n1 p1 /covar=2; run;

B7 Output with SAS

All relevant information can be found in the output as follows:

Coding Coefficients for the Independent Variables:

 Factor Subtracted off Divided by N1 2.000000 2.000000 P1 2.000000 2.000000

Response Surface for Variable YIELD:

- Response Mean 89.766667

- Root MSE 1.680511

- R-Square 0.9480

- Coef. of Variation 1.8721

 Regression d.f. Type I SoS R-Square F-Ratio Prob > F Covariates 2 523.611667 0.3442 92.704 0.0000 Linear 2 561.800417 0.3693 99.5 0.0000 Quadratic 2 344.886250 0.2267 61.061 0.0000 Crossproduct 1 11.886429 0.0078 4.209 0.0497 Total Regress 7 1442.184762 0.9480 72.953 0.0000

 d.f. SoS Mean Square Total Regress 28 79.075238 2.824116

 d.f. Parameter estimate Standard Error T for H0 Parameter= 0 Prob>|T| INTERCEPT 1 80.548810 0.830192 97.0 0.0000 N1 1 3.760714 0.657923 5.716 0.0000 P1 1 8.787798 0.657923 13.357 0.0000 N1*N1 1 -0.531250 0.148538 -3.577 0.0013 P1*N1 1 -0.230357 0.112284 -2.052 0.0497 P1*P1 1 -1.553125 0.148538 -10.456 0.0000 B1 1 2.780952 0.721884 3.852 0.0006 B2 1 -5.966667 0.686066 -8.697 0.0000

 Factor df SoS MS F-ratio Prob>F N1 3 180.551429 60.183810 21.311 0.0000 P1 3 749.908095 249.969365 88.512 0.0000

Canonical Analysis of Response Surface (based on coded data):

 Critical value Factor Coded Uncoded N1 0.486975 2.973950 P1 0.304262 2.608524

Predicted value at stationary point: 96.540583

Canonical Analysis of Response Surface (based on coded data):

 Eigenvectors Eigenvalues N1 P1 -2.073715 0.993861 -0.110633 -6.263785 0.110633 0.993861

Stationary point is a maximum.

The illustration for Example 2 from the book is discussed in Part A.

The information on these pages were kindly provided by Dr Rob Verdooren, Statistical Advisor of Numico-Research B.V. For further information on the statistical aspects of the experiments, please email Dr Verdooren directly.