-------- Original Message --------
Subject: p-value
Date: Sat, 5 Sep 2009 02:09:44 -0700 (PDT)
From: Samor Gandhi <[email protected]>
To: [email protected]
Dear all,
I still have problem who to get a p-value via permutations! Assume I have
x1 <- rgamma(10,3,0.5)
x2 <- rgamma(10,2,1)
the t.test function in R gives p- and t-value, where the p-value will be
< 0.05 (significant)! However, running permutations to compute the
p-value give non significant result!
simtest <- function(y1,y2){
tval <-
t.test(sample(y1,length(y1)-1),sample(y2,length(y2)-1))$statistic
}
tvalues <- c()
for(i in 1:100){ tvalues[i] <- simtest(x1,x2) }
pval <- sum(tvalues<t.test(x1,x2)$statistic)/100
pval
I am very thankful for any reply!
Samor
--
Replies will be sent to the list.
For more information visit http://www.morphometrics.org