View source: R/test_contrast_stagewise.R
test.contrast_stagewise | R Documentation |
A shortcut version for contrast testing and multiple testing correction using first test.contrast_adjust
to perform an ANOVA as a first stage.
In the second stage, the functions test.protLMcontrast
, prot.p.adjust_protwise
and prot.signif
are used sequentially only on the proteins retained in the first stage.
This approach is more powerful than the classic test.contrast_adjust
when testing for contrasts where related proteins are expected to be differentially abundant. This approach is also better for identifying interactions.
test.contrast_stagewise(protLM, L, level = 0.05, method_stage1 = "fdr", add.annotations = TRUE, simplify = TRUE, lfc = 0, type_dfs = "residual", custom_dfsS1 = NULL, custom_dfsS2 = NULL, exp_unit = NULL, pars_between = NULL, printProgress = FALSE, shiny = FALSE, message_extractS1 = NULL, message_testS1 = NULL, message_extractS2 = NULL, message_testS2 = NULL)
protLM |
An object of class |
L |
A contrast matrix with the parameter levels as rows and a column for each contrast. |
level |
The significance level at which the q-value needs to be controlled. Defaults to 5%. |
method_stage1 |
Correction method to be used in the first stage ANOVA. Can be abbreviated. Defaults to "fdr". To get all available methods, type |
add.annotations |
A logical indicating whether the |
simplify |
A logical indicating wheter, if there is only one contrast, a matrix should be returned instead of a list containing one matrix. Defaults to |
lfc |
The minimum (log2) fold-change that is considered scientifically meaningful. Defaults to |
type_dfs |
Either one of |
custom_dfsS1 |
Only used if |
custom_dfsS2 |
Only used if |
exp_unit |
Only used if |
pars_between |
Only used if |
printProgress |
A logical indicating whether the R should print a message before calculating the contrasts for each accession. Defaults to |
shiny |
A logical indicating whether this function is being used by a Shiny app. Setting this to |
message_extractS1 |
Only used when |
message_testS1 |
Only used when |
message_extractS2 |
Only used when |
message_testS2 |
Only used when |
Calculating degrees of freedom (and hence p values) for mixed models with unbalanced designs is an unresolved issue in the field (see for example here https://stat.ethz.ch/pipermail/r-help/2006-May/094765.html and here https://stat.ethz.ch/pipermail/r-sig-mixed-models/2008q2/000904.html).
We offer different approximations and leave it up to the user to select his/her preferred approach.
"residual"
calculates approximative degrees of freedom by subtracting the trace of the hat matrix from the number of observations. It is the default setting, but this approach might be somewhat too liberal.
"Satterthwaite"
calculates approximative degrees of freedom using Satterthwaite's approximation (Satterthwaite, 1946). This approximative approach is used in many applications but is rather slow to calculate and might lead to some missing values due difficulties in calculating the Hessian.
"exp_between"
calculates approximative degrees of freedom by defining on which level the treatments were executed and substracting all degrees of freedom lost due to between-treatement effects (pars_between
) from the number of experimental units exp_unit
. This allows to mimick the behaviour of type_dfs="between-within"
for more complex designs.
"custom"
Allows the user to provide his/her own degrees of freedom for each contrast and each protein. Custom degrees of freedom should be entered in the custom_dfs
field.
A list of matrices, with each matrix in the list corresponding to a contrast in L
. Each row of the matrix corresponds to a protein in the protLM
object.
The estimate
column contains the size estimate of the contrast, the se
column contains the estimated standard error on the contrast, the Tval
column contains the T-value corresponding to the contrast, the pval
column holds the p-value corresponding to the contrast and the qval
column holds the corrected p-values.
Each matrix is sorted from smalles to largest pval
with NA
values at the bottom of the matrices.
If simplify=TRUE
and the protLM
object contains only one element, the matrix is not present in a list.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.