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**)
Run the code above in your browser using DataLab