Hi there.
I have a data frame like this with n binomial samples:
df<-data.frame(success=c(1,2,3,2),total=c(2,4,5,3))
Where I have to get a confidence interval for each row with the lowest value and the highest. Something like this: "0.25 - 0.39"
I would have to apply for each row the funcion binom.confint from "binom" library. But I am having some troubles to apply that function to each row.
If i could, I would need something like this to get the lowest, with the "exact" method:
a<-binom.confint(df$success[1],df$total[1],0.95)[5,5]
And something like this to get the highest:
b<-binom.confint(vpip$played[1],vpip$total[1],0.95)[5,6]
Then i would have to paste them into something like this with each row:
final<-paste0(a,"-",b)
There is any way to get the binom.confint function for each row, to be able to do this?