Learn R Programming

lmPerm (version 2.1.0)

poly.formula: Makes a polynomial model

Description

Formulas are expanded to accommodate special functions for continuous and mixture variables.

Usage

poly.formula(frml)

Arguments

frml
A formula using ~ in the usual way.

Value

An expanded formula is returned.

Details

This function expands formulas to accommodate polynomial models for which R has minimal support. Assuming for illustration that there are three variables, A, B, and C, the following expressions may be used.

All agruments to quad(), cubic(), and cubicS() must be numeric.

  • quad(A,B,C) makes $(A+B+C)^2+I(A^2)+I(B^2)+I(C^2)$
  • cubic(A,B,C) makes $(A+B+C)^3+I(A^2)+I(B^2)+I(C^2)+I(A^3)+I(B^3)+I(C^3)$
  • cubicS(A,B,C) makes $(A+B+C)^3+I(A*B*(A-B))+I(A*C*(A-C))+I(B*C*(B-C))$

The cubicS() function produces a non-singular representation of a cubic model, when the variables are mixture variables, that is when the rows of data sum to a constant value, usually 1.0. Because of the mixture constraint, models containing mixture variables should not have a constant term. The linear and quadratic models for mixture variables A, B, and C are given by $-1+(A+B+C)$ and $-1+(A+B+C)^2$ respectively. See Gorman and Hinman [1962] for details.

References

Gorman, J.W. and Hinman, J.E. (1962). Simplex lattice designs for multicomponent systems. Technometrics. 4-4. 463-487.

Examples

Run this code

	poly.formula(y~quad(A,B,C)+Error(block))

Run the code above in your browser using DataLab