Description Usage Arguments Details Value Author(s) References See Also Examples
Tests all potential marginal interactions, and estimates false discovery rates at each potential cutoff
1 |
x |
An n-by-p matrix of covariates - observations in rows, features in columns. |
y |
An n-vector of class labels taking on two values (eg 0,1 or A,B) |
z |
An optional secondary n-by-q matrix of covariates - observations in rows, features in columns. |
numPerm |
The number of permutations to run |
numFDR |
The number of marginal interactions you would like to estimate FDR for — default is 1000 (more interactions can increase runtime). |
method |
A string, either "Pearson" or "Spearman", indicating which type of correlation is to be used. |
verbose |
A boolean flag indicating whether current permutation number should be output. |
A correlation matrix is constructed for each class (according to method). The function then apply a fisher transformation to these values and takes their difference. These values are ordered, and permutations are used to assess false discovery rate estimates. If no Z matrix is included then all pairwise correlations are considered for variables in X. If a Z matrix is included then only correlations between X and Z variables are considered.
interaction.ordered |
A dataframe of the |
internals |
Variables used interally for methods relating to interact |
Noah Simon, and Robert Tibshirani
Simon, N. and Tibshirani, R. (2012) A Permutation Approach to Testing Marginal Interactions in Many Dimensions, http://www-stat.stanford.edu/~nsimon/TMIcor.pdf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | set.seed(5)
n <- 100
p <- 10
s <- 5
X1 <- cbind(matrix(rnorm(n*s), ncol = s) + rnorm(n), matrix(rnorm(n*(p-s)), ncol = (p-s)))
X2 <- matrix(rnorm(n * p), ncol = p)
X <- rbind(X1, X2)
colnames(X) <- c("a","b","c","d","e","f","g","h","i","j")
y <- c(rep("y",n),rep("n",n))
fit <- interact(X,y)
print(fit)
plot(fit)
## Bigger Example (restricting the number of top interactions to consider)
## Not run:
## Not run:
n <- 300
p <- 500
s <- 10
X1 <- cbind(matrix(rnorm(n*s), ncol = s) + rnorm(n), matrix(rnorm(n*(p-s)), ncol = (p-s)))
X2 <- matrix(rnorm(n * p), ncol = p)
X <- rbind(X1, X2)
y <- c(rep("y",n),rep("n",n))
fit <- interact(X,y, numFDR = 50)
## Restricts the number of most significant interactions to consider to 50
print(fit)
plot(fit)
## End(Not run)
## Example Comparing (simulated) Genes and Enviromental Variables
## Not run:
n <- 100
p1 <- 100
p2 <- 10
Genes <- matrix(rnorm(n * p1), ncol = p1)
Environment <- matrix(rnorm(n * p2), ncol = p2)
y <- c(rep("y",n/2),rep("n",n/2))
fit <- interact(X = Genes,y, Z = Environment, numFDR = 50)
## Restricts the number of most significant interactions to consider to 50
print(fit)
plot(fit)
## End(Not run)
## End(**Not run**)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.