MixModel function

Fit mixture and mixture process variable models.

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))+ϵ1. y = sum from 1 to q (\beta(i)x(i)) + \epsilon.

    2.y=sumfromi=1toq(β(i)x(i))+sumfromi=1toq1sumj=i+1toq(β(ij)x(i)x(j))+ϵ2. y = sum from i=1 to q (\beta(i)x(i)) + sum from i=1 to q-1 sum j=i+1 to q (\beta(ij)x(i)x(j)) + \epsilon.

    3.y=sumfromi=1toq(β(i)x(i))+sumfromi=1toq1sumj=i+1toq(β(ij)x(i)x(j))+sumi=1toq1sumj=i+1toq(δ(ij)x(i)x(j)(x(i)x(j))+sumi=1toq2sumj=i+1toq1sumk=j+1toq(β(ijk)x(i)x(j)x(k))+ϵ3. y = sum from i=1 to q (\beta(i)x(i)) + sum from i=1 to q-1 sum j=i+1 to q (\beta(ij)x(i)x(j)) + sum i=1 to q-1 sum j=i+1 to q (\delta(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 (\beta(ijk)x(i)x(j)x(k)) + \epsilon.

    4.y=sumfromi=1toq(β(i)x(i))+sumfromi=1toq1sumj=i+1toq(β(ij)x(i)x(j))+sumi=1toq2sumj=i+1toq1sumk=j+1toq(β(ijk)x(i)x(j)x(k))+ϵ4. y = sum from i=1 to q (\beta(i)x(i)) + sum from i=1 to q-1 sum j=i+1 to q (\beta(ij)x(i)x(j)) + sum i=1 to q-2 sum j=i+1 to q-1 sum k=j+1 to q (\beta(ijk)x(i)x(j)x(k)) + \epsilon.

    5.y=(sumfromi=1toq(β(i)x(i))+sumfromi=1toq1sumj=i+1toq(β(ij)x(i)x(j)))(α(0)+sumfroml=1top(α(l)z(l))+sumfroml=1top1sumfromm=l+1top(α(lm)z(l)z(m)))+ϵ5. y = (sum from i=1 to q (\beta(i)x(i)) + sum from i=1 to q-1 sum j=i+1 to q (\beta(ij)x(i)x(j))) (\alpha(0)+sum from l=1 to p (\alpha(l)z(l)) + sum from l=1 to p-1 sum from m=l+1 to p (\alpha(lm)z(l)z(m)))+ \epsilon.

    6.y=sumfromi=1toq(β0(i)x(i))+sumfromi=1toq1sumj=i+1toq(β0(ij)x(i)x(j))+sumfromk=1tom[sumfromi=1toqβ1x(i)]z(k)+sumk=1tom1sumfroml=k+1tomα(kl)z(k)z(l)+sumfromk=1tomα(kk)z2(k)+ϵ6. y = sum from i=1 to q (\beta^0(i)x(i)) + sum from i=1 to q-1 sum j=i+1 to q (\beta^0(ij)x(i)x(j)) + sum from k=1 to m[sum from i=1 to q \beta^1x(i)]z(k) + sum k=1 to m-1 sum from l=k+1 to m \alpha(kl)z(k)z(l) + sum from k=1 to m \alpha(kk)z^2(k)+ \epsilon

    where x(i)x(i) are mixture components, and z(j)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

  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"

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"))
  • Maintainer: John Lawson
  • License: GPL (>= 2)
  • Last published: 2024-10-23

Useful links