Linear Model
This class provides the ability to specify a linear model (for use in regression and design of experiments). This is only a string specification of the model. The terms are specified by the names of the factors.
Example: A model with 3 main effects, "A", "B", "C", with full model = "A B C AB AC BC ABC". // y = b0 + b1A + b2B + b3C + b12AB + b13AC + b23BC + b123ABC val m3 = LinearModel(setOf("A", "B", "C")) m3.specifyAllTerms()
The properties termsAsMap and termsAsList provide access to the specification.
Parameters
the names of the factors (regressors) in a set
the type of model to start with. The default is first order terms (main effects) as define by the provided set of main effects.
Types
Properties
Functions
Shorthand for adding a cubic term.
Every string in the list must be within the main effects set to be valid.
Shorthand for adding an n-way interaction term.
Assumes a parsable string and converts it to a list of terms for specifying the model from the string.
Shorthand for adding a quadratic term.
Specifies a model with all terms (main effects, first order interactions, 2nd order interactions, etc.
Add a term to the model. It is assumed that the list of strings represents a product term. Thus, listOf("A", "B") is the interaction term "A*B". The elements of the list must be valid single (main) effect term names.
Shorthand for adding a two-way interaction term. The names must be different.