I’m trying to do multiply permutation tests, my code look like: >one.test<- function(x,y){
+ xstar<-sample(x) + anova(lm(y ~ xstar)) + } >z<-function(x) replicate (1000,one.test(x,BPH)$"F value"[1]) # gives me 1000 permute F values > perm_Fvalue<- apply(assoc_BPH[,3:900],2,z) >a <- function(x) anova(lm(BPH ~ x))$"F value”[1] # # give me the reals F values > real_F <- apply(assoc_BPH[,3:900],2,a) # How can I attach the “real_F” function and a calculation function for the new P-value to the original z function, so by > apply(assoc_BPH[,3:900],2,z) I will get the new P-value for each variable? Thanks Imri -- View this message in context: http://www.nabble.com/Extract-the-P-value-from-of-permutation-tests-tp24565402p24565402.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.