How can I calculate the standard error for a binary variable using R? I have a group of participants performing a task across several conditions. The output might be 0 (incorrect) or 1 (correct). I have calculated the mean proportion of correct answers and standard error (SE) in the next way:
mean<-tapply(dataRsp$Accuracy, dataRsp$Condition, FUN=mean)
SE<- with(dataRsp, tapply(Accuracy, Condition, sd)/sqrt(summary(dataRsp$Condition)) )
But the SE are extremelly tight that they can hardly be correct. Might someone give me some ideas?I found that the next might be the solution,
sqrt(p.est*(1-p.est)/n)
... but I don't know how to implement it to R.