#load test data
data(mdr1)
#define matrix of all two-way combinations of 15 SNPs; this 105 by 2 matrix defines the 105 combinations of two-way interactions to consider
loci<-t(combn(15,2))
#this runs mdr on the sample data, considering the two-way combinations in 'loci', saving the top 5 models, and defining the threshold as 1 since the data is balanced
fit<-mdr(mdr1,loci,x=5,ratio=1)
print(fit) #view the fitted mdr object
Run the code above in your browser using DataLab