It is easy to perform an accurate binomial test in two ways, but what happens if you want to test for a whole bunch of successes and tests. I created a dataframe of test sensitivity, the potential number of students enrolled in the study, and then for each row I calculate how success can be. Here is the code.
sens <-seq(from=.1, to=.5, by=0.05)
enroll <-seq(from=20, to=200, by=20)
df <-expand.grid(sens=sens,enroll=enroll)
df <-transform(df,succes=sens*enroll)
But how can I use each combination of strings from successes and the number of tests to perform a binomial test.
I'm only interested in the upper limit of the 95% confidence interval of the binomial test. I want this single number to be added to the data frame as a column named "upper.limit"
I was thinking about something in the lines
binom.test(succes,enroll)$conf.int
alas, conf.int -
[1] 0.1266556 0.2918427
( "conf.level" )
[1] 0,95
, , 0.2918427
, , do.call - , , , , . plyr?
, . , .