## S3 method for class 'design':
formula(x, ..., response=NULL, degree=NULL, FUN=NULL,
use.center=TRUE)
design
formula
x
)
OR
integer number giving the position of the response in element
response.names
of attribute desi
aggregate.design
method;
this must be an unquoted function name or NULL
;
This option is relevant for repeated measurement designs
and parameter despb
and FrF2
designs with
center points onlylm.design
formula
creates an appropriate formula for many kinds of
objects, e.g. for data frames (try e.g. formula(swiss)
). Function
as.formula
uses function formula, but cannot take any additional
arguments.
The method for class design
objects modifies the way a data frame
would normally be treated by the formula
function. This also carries through
to default linear models.
Without the additional arguments, the function creates the formula with the first
response from the response.names
element of the design.info
attribute.
The default degree depends on the type of design: it is
oa
and pb
}
formula
and lm.design
## indirect usage via function lm.design is much more interesting
## cf help for lm design!
my.L18 <- oa.design(ID=L18,
factor.names = c("one","two","three","four","five","six","seven"),
nlevels=c(3,3,3,2,3,3,3))
y <- rnorm(18)
my.L18 <- add.response(my.L18, y)
formula(my.L18)
lm(my.L18)
Run the code above in your browser using DataLab