############################################## # Example Code for SPAr ############################################## install.packages('SPAr', repos='http://cran.r-project.org',type="source") library(SPAr) data(SPA_example) attach(SPA_example) ## compute p-values of dichotomous traits pstar_dich <- SPA.I(x,y.d,nperm=100) #compute I1,I2 and p* and their p-values print(pstar_dich) I1_dich <- SPA.I(x,y.d,interaction=1,nperm=100) # only compute I1 and its pvalue print(I1_dich) ## compute p-values of continuous traits pstar_cont <- SPA.I(x,y.c,nperm=10,type="cont") #compute I1,I2 and p* and their p-values print(pstar_cont) I1_cont <- SPA.I(x,y.c,type="cont",interaction=1,nperm=100) # only compute I1 and its pvalue print(I1_cont) ## compute G-E interaction effect SPA.I.GE <- SPA.I.GE(x,y.d,E,nperm=100) print(SPA.I.GE)