Description Usage Arguments Details Value Data Shuffling Author(s) References See Also Examples
This is the function to perform F or T test on one or multiple experimental factor(s). Permutation test will be carried upon request.
1 2 3 4 5 |
data |
An object of class |
anovaobj |
An object of class |
term |
The term(s) to be tested. It can be multiple terms. Note that the tested term must be fixed. If the term to be tested is a random term, it will be converted to a fixed term than do test. |
Contrast |
The contrast matrix for the term. The number of
columns equals to the number of levels in the term. The number of
rows is the number of T-test you want to carry. Note that it must
be a matrix. Use |
n.perm |
An integer for number of permutations. |
nnodes |
Number of nodes in the MPI cluster. If 1, the permutation test will be running on the local computer. |
critical |
percentile of F-distribution used to get a subset to calculate p-value. Default is 90th percentile of F-distribution, and permutation analysis is conducted based on genes whose test statistics are smaller than 90th percentile of the F-distribution. |
test.type |
Test type. It could be F-test or T-test. If the Contrast matrix is missing, this should be a "ftest" and the contrast matrix is generated automatically to cover the whole linear space except for testing covariates. If the Contrast matrix is given, this could be "ftest" or "ttest". The default is "ttest" (for backward compatability). For T-test, the code will do a series of T-test, where each T-test corresponds to a row in the contrast matrix. |
shuffle.method |
Data shuffling method. "sample" for sample shuffling and "resid" for residual shuffling. Read "Data Shuffling" section for detail. |
MME.method |
The method used to solve the Mixed Model Equations. See
|
test.method |
An integer vector of two elements to indicate which F test to carry. Default is c(1,1), which means do F1 and Fs test. |
pval.pool |
A logical value to indicate whether to use pooled permutation F values to calculate the P values. |
verbose |
A logical value to indicate whether to display some message for calculation progress. |
If user provide a comparison matrix, this function will perform T-test on the given comparison(s). Otherwise, this function will perform F-test for the given term.
There are three types of tests available. All three tests are based on the gene-specific ANOVA model. F1 is the usual F statistic, Fs is based on the James-Stein shrinkage estimates of the error variance.
Permutation tests can run on MPI cluster. This feature is only available for Unix/Linux system. Several other R packages (such like SNOW, Rmpi, etc.) are needed for using cluster. You may need help from your system administrator to setup LAM-MPI correctly. For detailed information on LAM-MPI cluster setup and the cluster usage in R, read "MPI\_README" distributed with the package.
An object of class matest
, which is a list of the following
components:
model |
Input model object. |
term |
The input term(s) to be tested. |
dfde |
Denominator's degree of freedom for the test. |
dfnu |
Numerator's degree of freedom for the test. Note that this is always 1 for T-test. |
obsAnova |
An object of |
Contrast |
The contrast matrix used in the test. |
n.perm |
Number of permutations. |
shuffle |
Shuffle style |
pval.pool |
Use pooled P value or not. |
F1, Fs |
Objects of four different F tests results. All or any of them could be there according to the requested F test method. Each of them contains the following fields:
All the F values and P values are matrices. The number of rows in the matrices equals to the number of genes. For F-test, the number of columns will be one. For T-test, the number of columns equals to the number of tests carried. |
Data shuffling method is a crucial part in the permutation test. Currently there are two shuffling method available, residual shuffling and sample shuffling.
Residual shuffling is to shuffle the null model residuals within gene without replacement.
Sample shuffling is to shuffle the samples based on the nesting relationship among the experimental factors in the model. For sample shuffling, you need to make sure you have a good sample size. Otherwise the result may be biased.
Hao Wu
Cui, X. and Churchill,GA (2003), Statistical tests for differential expression in cDNA Microarray experiments, Genome Biology 4:210.
Cui, X., Hwang, J.T.G., Blades N., Qiu J. and Churchill GA (2003), Improved statistical tests for differential gene expression by shrinking variance components, to be submitted.
1 2 3 4 5 6 7 8 9 10 11 | # load in abf1 data
data(abf1)
## Not run:
fit.full.mix <- fitmaanova(abf1, formula = ~Strain+Sample,
random = ~Sample)
ftest.all = matest(abf1, fit.full.mix, test.method=c(1,1),
shuffle.method="sample", term="Strain", n.perm= 100)
C = matrix(c(1,-1,0,1,0,-1), ncol=3, byrow=T)
ftest.pair = matest(abf1, fit.full.mix, Contrast = C,
term="Strain", n.perm=100)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.