Learn R Programming

ACSWR (version 1.0.1)

chemicaldata: Chemical Reaction Experiment

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

data(chemicaldata)

Arguments

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

References

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

Examples

Run this code
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])

Run the code above in your browser using DataLab