# chemicaldata: Chemical Reaction Experiment In ACSWR: A Companion Package for the Book "A Course in Statistics with R"

## Description

This data set is used to illustrate the concept of canonical correlations. Here, temperature, concentration, and time have influence on three yield variables, namely outputs, while the percentage of unchanged starting material, the percentage converted to the desired product, and the percentage of unwanted by-product form another set of related variables.

## Usage

 `1` ```data(chemicaldata) ```

## Format

A data frame with 19 observations on the following 6 variables.

`y1`

the percentage of unchanged starting material

`y2`

the percentage converted to the desired product

`y3`

the percentage of unwanted by-product

`x1`

temperature

`x2`

concentration

`x3`

time

## Source

Box, G. E. P., and Youle, P. V. (1955). The Exploration of Response Surfaces: An Example of the Link between the Fitted Surface and the Basic Mechanism of the System. Biometrics, 11, 287-323.

## References

Rencher, A.C. (2002). Methods of Multivariate Analysis, 2e. J. Wiley.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13``` ```data(chemicaldata) names(chemicaldata) chemicaldata\$x12 <- chemicaldata\$x1*chemicaldata\$x2; chemicaldata\$x13 <- chemicaldata\$x1*chemicaldata\$x3; chemicaldata\$x23 <- chemicaldata\$x2*chemicaldata\$x3 chemicaldata\$x1sq <- chemicaldata\$x1^{2} chemicaldata\$x2sq <- chemicaldata\$x2^{2} chemicaldata\$x3sq <- chemicaldata\$x3^{2} S_Total <- cov(chemicaldata) cancor_xy <- sqrt(eigen(solve(S_Total[1:3,1:3])%*%S_Total[1:3, 4:12]%*%solve(S_Total[4:12,4:12])%*%S_Total[4:12,1:3])\$values) cancor_xy cancor(chemicaldata[,1:3],chemicaldata[,4:12]) ```

### Example output

```[1] "y1" "y2" "y3" "x1" "x2" "x3"
[1] 0.9899310 0.9527848 0.4625105
\$cor
[1] 0.9899310 0.9527848 0.4625105

\$xcoef
[,1]     [,2]      [,3]
y1 0.03633122 0.105741 0.1370980
y2 0.01053532 0.141372 0.1113374
y3 0.01637909 0.109678 0.1802051

\$ycoef
[,1]         [,2]         [,3]         [,4]         [,5]
x1   -0.1899827945  1.451849573 -0.474047241  0.777105268  0.586176410
x2   -0.3257326031  0.986862460 -1.347918602 -0.797899684  1.570473213
x3   -0.2381627081  1.150350487 -4.725503269  0.766577357 -3.400981204
x12   0.0014223738 -0.006999103  0.004332180  0.003781449 -0.007361815
x13   0.0019845315 -0.005529987  0.026974496 -0.003481674  0.021206299
x23  -0.0022332960 -0.003401072  0.005456217 -0.001673517 -0.003687744
x1sq  0.0003010213 -0.003703408  0.000547203 -0.002556990 -0.001541188
x2sq  0.0012691153  0.003458202  0.011099880  0.002347478 -0.006029907
x3sq -0.0066453421 -0.010175317  0.011309972 -0.005143419 -0.008011058
[,6]         [,7]          [,8]          [,9]
x1    0.3135410754  2.300699677 -0.4893089001 -0.9081431157
x2   -0.4163913662  0.555412457 -2.4984482609  0.0363422000
x3    2.2993792248 -0.451471963  1.4204571381  1.5789903294
x12   0.0009569456 -0.002885273  0.0101864282 -0.0004654941
x13  -0.0226831262  0.002011381 -0.0058249768 -0.0118821624
x23   0.0556472717  0.001958109 -0.0181924800 -0.0309348700
x1sq -0.0005366219 -0.006677956  0.0007956929  0.0030016633
x2sq -0.0023636413 -0.001352329  0.0170847282  0.0046834555
x3sq -0.0032264472  0.002596997 -0.0024829438  0.0972183818

\$xcenter
y1       y2       y3
20.17895 56.33684 20.78421

\$ycenter
x1          x2          x3         x12         x13         x23
167.31579    27.18421     6.50000  4536.81579  1087.34211   177.85526
x1sq        x2sq        x3sq
28031.21053   755.98684    44.77632
```

ACSWR documentation built on May 2, 2019, 6:53 a.m.