Fit mixture and mixture process variable models.
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.
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=sumfrom1toq(β(i)x(i))+ϵ.
2.y=sumfromi=1toq(β(i)x(i))+sumfromi=1toq−1sumj=i+1toq(β(ij)x(i)x(j))+ϵ.
3.y=sumfromi=1toq(β(i)x(i))+sumfromi=1toq−1sumj=i+1toq(β(ij)x(i)x(j))+sumi=1toq−1sumj=i+1toq(δ(ij)x(i)x(j)(x(i)−x(j))+sumi=1toq−2sumj=i+1toq−1sumk=j+1toq(β(ijk)x(i)x(j)x(k))+ϵ.
4.y=sumfromi=1toq(β(i)x(i))+sumfromi=1toq−1sumj=i+1toq(β(ij)x(i)x(j))+sumi=1toq−2sumj=i+1toq−1sumk=j+1toq(β(ijk)x(i)x(j)x(k))+ϵ.
5.y=(sumfromi=1toq(β(i)x(i))+sumfromi=1toq−1sumj=i+1toq(β(ij)x(i)x(j)))(α(0)+sumfroml=1top(α(l)z(l))+sumfroml=1top−1sumfromm=l+1top(α(lm)z(l)z(m)))+ϵ.
6.y=sumfromi=1toq(β0(i)x(i))+sumfromi=1toq−1sumj=i+1toq(β0(ij)x(i)x(j))+sumfromk=1tom[sumfromi=1toqβ1x(i)]z(k)+sumk=1tom−1sumfroml=k+1tomα(kl)z(k)z(l)+sumfromk=1tomα(kk)z2(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
References
- "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"
Author(s)
John S. Lawson lawson@byu.edu
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"))