Reputation: 85
I have a vector with values between 0 and 1 (the name of my vector is pvals) and I would like to keep the elements of my vector pvals which respect the condition:
pvals(i) < i/m*alpha
where alpha = 0.05 and m = 1000 (the size of my vector pvals)
how can i do please? here i create my pvals vector, and indexes i, but after that i don't know how to make what i explained above:
pvals = runif(1000, 0, 1)
i = seq(along=pvals)
Upvotes: 1
Views: 592
Reputation: 736
Based on your described question, this should work.
If m
and alpha
exist outside of pvals
:
pvals<-pvals[pvals$i < pvals$i/m*alpha,]
I hope this helps!
Upvotes: 1