Builds a design matrix from a one side formula or a number of factors.
Usage
fp_design_matrix(arg, rep = 1, levels = c(-1, 1))
Value
A design matrix: a subclass of a tibble of class factorial.plan.
The class has the following attributes:
def.rel
The defining relationship (a formula).
generators
The list of generators (formulas) if the factorial plan is fractional.
fraction
The list of fractions (character vectors) if the factorial plan is fractional.
levels
The levels of the factors (all equal), in coded units.
scales
A list: for each factor, a vector of two values corresponding to the extreme values in coded units.
Arguments
arg
Either a formula or a number of factors. If it is a formula, the
factors are extracted from it. If it is a number, the factors are the first
n capital letters.
rep
Number of replications.
levels
Levels of the factors.
Details
Defining relationships are represented as one side formulas, e.g. $I=ABC$
becomes ~A*B*C.