[R] Binom.test, vector input
dafshartous at med.miami.edu
Thu Oct 9 21:42:15 CEST 2008
Is it possible to use binom.test with vector input for only one of the
arguments? I was thinking that this would possibly work with sapply but
then it seems that the binom.test function would have to be re-written to
supply defaults for all other arguments.
sim.x = rbinom(100, 10, .8) ## generate 100 values distributed B(10, .8)
# test of first sample against H.0: p=.6
binom.test(sim.x, n = 10, p = .6, alternative = "greater")
Is it possible to do the same test for all the rest without a loop or
re-writing the binom.test function?
R version 2.7.1 (2008-06-23)
attached base packages:
 stats graphics grDevices utils datasets methods base
More information about the R-help