[R] Multiple binomial tests on a large table

Wilson, Andrew a.wilson at lancaster.ac.uk
Thu Jul 29 10:05:03 CEST 2010


I need to run binomial tests (binom.test) on a large set of data, stored
in a table - 600 tests in total.

The values of x are stored in a column, as are the values of n.  The
data for each test are on a separate row.

For example:

X	N
11	19
9	26
13	21
13	27
18	30

It is a two-tailed test, and P in all cases is 0.5.

My question is:  Is there a quicker way of running these tests without
having to type an individual command for each test - and ideally also to
store the resulting p-values in a single data vector?

Many thanks for any pointers,

Andrew Wilson



More information about the R-help mailing list