Description Creating Objects Slots Extends Methods Author(s) See Also Examples
Class to Contain the Contrast Matrix that Used for Linear Regression, inherited from the designMatrix class
new("contrastMatrix", ...,
design.matrix=[designMatrix],
compare1=[character],
compare2=[character],
level=[character],
interaction==[numeric])
.
This creates a contrast matrix class. design.matrix
is a designMatrix
class. compare1
the first value of the main covariate, and compare2
is the second value of the main covariate.
For example, suppose that the main covariate is "drug", and there
are three unique values: "drug1", "drug2", and "placebo".
You would like to compare "drug1" to "drug2". Then you would use "drug1" as
compare1
and "drug2" as compare2
. If interaction==TRUE
,
do not specify compare1
and compare2
. You only specify
level
when the design matrix contains an interaction term.
Suppose that you would like to compare "drug1" to "drug2" only when estrogen is
"present", where "present" is one of the values of the estrogen variable.
You will use "present" as level. If interaction==TRUE
, do not specify this
value as well. You only specify interaction=TRUE
when you would like to
detect the interaction effect between two covariates. In this case,
do not provide values for compare1
, compare2
, and level
contrast
:Object of class "matrix"
contains the contrast matrix
compare1
:Object of class "character"
contains compare1
compare2
:Object of class "character"
contains compare2
level
:Object of class "character"
contains level
interaction
:Object of class "logical"
contains interaction
design
:Object of class "matrix"
contain the design matrix
target
:Object of class "data.frame"
contains target
covariates
:Object of class "character"
contains covariates
intIndex
:Object of class "numeric"
contains intIndex
Class "designMatrix"
, directly.
signature(object = "contrastMatrix")
:
access the compare1
slot
signature(object = "contrastMatrix")
:
access the compare2
slot
signature(object = "contrastMatrix")
:
access the contrast
slot
signature(object = "contrastMatrix")
:
access the interaction
slot
signature(object = "contrastMatrix")
:
access the level
slot
signature(.Object = "contrastMatrix")
:
create a new contrast matrix class
signature(object = "contrastMatrix")
: print the contrast matrix
Xiwei Wu, Arthur Li
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | data(eSetExample)
## One-way Anova
(design1<- new("designMatrix", target=pData(eSetExample), covariates = "Treatment"))
(contrast1<- new("contrastMatrix", design.matrix = design1,
compare1 = "Treated", compare2 = "Control"))
## Randomized block design
(design2<- new("designMatrix", target=pData(eSetExample),
covariates = c("Treatment", "Group")))
(contrast2<- new("contrastMatrix", design.matrix = design2,
compare1 = "Treated", compare2 = "Control"))
## Interaction design
(design3<- new("designMatrix", target=pData(eSetExample),
covariates = c("Treatment", "Group"), intIndex=c(1,2)))
# Test for interaction:
(contrast.int<- new("contrastMatrix", design.matrix = design3,
interaction=TRUE))
# Compare Treated vs Control among group A
(contrast.a<- new("contrastMatrix", design.matrix = design3,
compare1 = "Treated", compare2 = "Control", level="A"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.