# Analyze interaction effect and produce output

### Description

This wrapper function will create a design matrix and contrast matrix for the interaction test. Then it will fit linear model to test for interaction effect for each gene and identify genes for which interaction test is being significant. For genes having the interaction effect, it fits linear model for each genes in each level of strata.var. For genes don't have interaction effect, it fits linear model for each genes without stratifying the strata.var. In the end, it will output signficant result.

### Usage

1 2 3 | ```
AffyInteraction(object, method, main.var, strata.var, compare1, compare2,
covariates=NULL, p.int=0.05, m.int=0, adj.int="none", p.value=0.05,
m.value=0, adj="none", filename1="result", filename2="inter_result")
``` |

### Arguments

`object` |
an "ExpressionSet" |

`method` |
Three methods are supported by this function: "L" for using LIMMA method - compute moderated t-statistics and log-odds of differential expression by empirical Bayes shrinkage of the standard errors towards a common value; "F" for using ordinary linear regression; "P" for permuation test by resampling the phenotype |

`main.var` |
the variable of your main interest |

`strata.var` |
a categorical variable serves as a potential effect modifier. An effect modifier is a variable that modifies the association between outcome variable and the main variable. If the interaction exits, the association between the outcome and main.var will be analyzed separately within each stratum of strata.var |

`compare1` |
first value of the variable of main interest. Suppose the main variable is "estrogen", and its has two values: "present" and "absent". You would like to compare "present" versus "absent". Then you will use compare1 = "present" |

`compare2` |
second value of the variable of main interest. Follow from the same example above, you will set compare2 = "absent" |

`covariates` |
a list of covariates, not including main.var and strata.var, the default value is NULL |

`p.int` |
p value for the interaction test |

`m.int` |
fold change cut-off value for the interaction test |

`adj.int` |
adjustment method for multiple comparison for testing interaction, including "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none". Type help(p.adjust) for more detail. |

`p.value` |
p value for main effect test |

`m.value` |
fold change cut-off value for main effect test |

`adj` |
adjustment method for multiple comparison for testing main effect |

`filename1` |
name of the output file for the main effect |

`filename2` |
name of the output file for the interaction test |

### Value

a list of data frame: The first data frame contains results for genes with interaction effect. The second data frame contains results for genes don't have interaction effect. The rest of the data frames contain information for main effects for each stratum of strata.var.

### Author(s)

Xiwei Wu xwu@coh.org, Xuejun Arthur Li xueli@coh.org

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
## Suppose that you would like to test the interaction effect between "gender"
## and "group" variables, "gender" is the main effect variable. For genes in
## which the interaction test are being significant, you would like to compare
## "M" vs. "F" within each level of "group". For genes in which the interaction
## test are not being significant, you would like to compare "M" vs. "F" without
## stratifying "group".
data(testData)
normaldata<-pre.process("rma",testData)
result<-AffyInteraction(normaldata, "L", "gender", "group","M", "F", p.int=0.05,
m.int=0, adj.int="none", p.value=0.05, m.value=0, adj="none",
filename1="result1", filename2="result2")
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.