Learn R Programming

rsm (version 1.40)

rsm: Response-surface regression

Description

Fit a linear model with a response-surface component, and produce appropriate analyses and summaries.

Usage

rsm (...)
## S3 method for class 'rsm':
summary(object, ...)
## S3 method for class 'summary.rsm':
print(x, ...)

loftest (object)
canonical (object)
## S3 method for class 'rsm':
codings(object)

Arguments

...
In rsm, arguments that are passed to lm. The model must include an FO() or SO() term.to define the response-surface portion of the model. In summary
object
An object of class rsm
x
An object produced by summary

Value

  • rsm returns an rsm object, which is a lm object with additional members as follows:
  • orderThe order of the model: 1 for first-order, 1.5 for first-order plus interactions, or 2 for a model that contains square terms.
  • bThe first-order response-surface coefficients.
  • BThe matrix of second-order response-surface coefficients, if present.
  • labelsLabels for the response-surface terms. These make the summary much more readable.
  • codingCoding formulas, if provided in the codings argument or if the data argument passed to lm is a coded.data object.
  • summary is the summary method for rsm objects. It returns an object of class summary.rsm, which is an extension of the summary.lm class with additional list elements:
  • saUnit-length vector of the path of steepest ascent (first-order models only).
  • canonicalCanonical analysis (second-order models only). This is a list with elements xs, the stationary point, and eigen, the eigenanalysis of B (see above).
  • lofANOVA table including lack-of-fit test.
  • codingCoding formulas in parent rsm object.
  • Its print method shows the regression summary, followed by an ANOVA and lack-of-fit test. For first-order models, it shows the direction of steepest ascent, and for second-order models, it shows the canonical analysis of the response surface. loftest returns an anova object that tests the fitted model against a model that interpolates the means of the response-surface-variable combinations. canonical returns the canonical element from summary.rsm. codings.rsm returns a list of coding formulas if the model was fitted to coded.data, or NULL otherwise.

Details

In rsm, the model formula must contain at least an FO term; optionally, you can add a TWI() term and/or a PQ() term as well (use the same variables in each!). For convenience, specifying SO() is the same as including FO(), TWI(), and PQ(), and is the safe, preferred way of specifying a full second-order model.

References

Lenth RV (2009). ``Response-Surface Methods in R, Using rsm'', Journal of Statistical Software, 32(7), 1--17. http://www.jstatsoft.org/v32/i07/.

See Also

FO, SO, lm, summary, coded.data

Examples

Run this code
library(rsm)
CR = coded.data (ChemReact, x1~(Time-85)/5, x2~(Temp-175)/5)

### 1st-order model, using only the first block
CR.rs1 = rsm (Yield ~ FO(x1,x2), data=CR, subset=1:7) 
summary(CR.rs1)

### 2nd-order model, using both blocks
CR.rs2 = rsm (Yield ~ Block + SO(x1,x2), data=CR) 
summary(CR.rs2)

Run the code above in your browser using DataLab