Creates the contrast that compares the treatment group(s) with
the control group(s) of a design matrix created with
create_design_matrix. When more than one group is given
on one side, their average is used.
Arguments
- design
A design matrix created with
create_design_matrix.- treatment
The name(s) of the treatment group(s), as in the groups of the ScreenR object or as in the column names of the design matrix.
- control
The name(s) of the control group(s), as in the groups of the ScreenR object or as in the column names of the design matrix.
Value
A named numeric vector with one value for each column of the design matrix: 1 / (number of treatment groups) for the treatment groups, -1 / (number of control groups) for the control groups and 0 for the others.
Examples
object <- get0("object", envir = asNamespace("ScreenR"))
design <- create_design_matrix(object)
create_contrast(design, treatment = "Treated", control = "Control")
#> Control T1.T2 Treated
#> -1 0 1
