MixModel: Fit mixture and mixture process variable models.

View source: R/MixModel.R

MixModelR Documentation

Fit mixture and mixture process variable models.

Description

This function fits mixture models (1)-(4) and mixture process models (5)-(6) described in Lawson and Willden(2015) "Mixture Experiments in R, using mixexp", Journal Statistical Software http://www/jstatsoft.org/, and prints the correct R square and standard errors of model coefficients.

Usage

MixModel(frame, response, mixcomps=NULL,model,procvars=NULL)

Arguments

frame

a data frame containing columns with the mixture components, process variables, and responses

response

a character variable containing the column name of the response variable in frame to be fit

mixcomps

a character vector of column names of the mixture components in frame

model

an integer in the range of 1 to 6, indicating the model to be fit:

1. y = sum from 1 to q (β(i)x(i)) + ε.

2. y = sum from i=1 to q (β(i)x(i)) + sum from i=1 to q-1 sum j=i+1 to q (β(ij)x(i)x(j)) + ε.

3. y = sum from i=1 to q (β(i)x(i)) + sum from i=1 to q-1 sum j=i+1 to q (β(ij)x(i)x(j)) + sum i=1 to q-1 sum j=i+1 to q (δ(ij)x(i)x(j)(x(i)-x(j)) + sum i=1 to q-2 sum j=i+1 to q-1 sum k=j+1 to q (β(ijk)x(i)x(j)x(k)) + ε.

4. y = sum from i=1 to q (β(i)x(i)) + sum from i=1 to q-1 sum j=i+1 to q (β(ij)x(i)x(j)) + sum i=1 to q-2 sum j=i+1 to q-1 sum k=j+1 to q (β(ijk)x(i)x(j)x(k)) + ε.

5. y = (sum from i=1 to q (β(i)x(i)) + sum from i=1 to q-1 sum j=i+1 to q (β(ij)x(i)x(j))) (α(0)+sum from l=1 to p (α(l)z(l)) + sum from l=1 to p-1 sum from m=l+1 to p (α(lm)z(l)z(m)))+ ε.

6. y = sum from i=1 to q (β^0(i)x(i)) + sum from i=1 to q-1 sum j=i+1 to q (β^0(ij)x(i)x(j)) + sum from k=1 to m[sum from i=1 to q β^1x(i)]z(k) + sum k=1 to m-1 sum from l=k+1 to m α(kl)z(k)z(l) + sum from k=1 to m α(kk)z^2(k)+ ε

where x(i) are mixture components, and z(j) are process variables.

procvars

a character vector of column names of the process variables in frame to be included in the model. Leave this out if there are no process variables in the frame

Author(s)

John S. Lawson lawson@byu.edu

References

1. "John Lawson, Cameron Willden (2016).", "Mixture Experiments in R Using mixexp.", "Journal of Statistical Software, Code Snippets, 72(2), 1-20.", "doi:10.18637/jss.v072.c02"

Examples

# example from Lawson(2014), quadratic model
library(daewr)
data(pest)
mixvars<-c("x1","x2","x3")
MixModel(pest,"y",mixvars,2)

# example from Myers and Montgomery(2002), special cubic model
library(mixexp)
etch<-SCD(3)
etch<-Fillv(3,etch)
etch<-rbind(etch[1:7, ],etch[1:3, ],etch[7, ], etch[etch$x1==2/3, ],
etch[etch$x2==2/3, ],etch[etch$x3==2/3, ])
erate<-c(540,330,295,610,425,330,800,560,350,260,850,710,640,460)
etch<-cbind(etch,erate)
mixvars<-c("x1","x2","x3")
response<-c("erate")
MixModel(etch,response,mixvars,4)

# example Mixture process variable model from Sahni, Pieple and Naes(2009)
library(daewr)
mixvars<-c("x1","x2","x3")
procvars<-c("z1","z2")
data(MPV)
MixModel(MPV,"y",mixvars,5,procvars)

#### Kowalski Cornell and Vining Simplified model on data from Gallant et. al. (2008)
data(Burn)
testBNM<-MixModel(Burn,"y",mixcomps=c("Course","Fine","Binder"),model=6,procvars=c("z"))


          

mixexp documentation built on May 28, 2022, 3:01 a.m.