In Stata you can use proportion
if a variable has more than two categories:
//sample data
sysuse auto, clear
keep if (headroom==2.0 |headroom==2.5)
gen prop=.
replace prop=0 if headroom==2.0
replace prop=1 if headroom==2.5
//say 0 is yes and 1 is no
set seed 123
bootstrap _b, reps(100):proportion prop
Updated as per @Nick: For binary variable, the following is sufficient
bootstrap r(mean), reps(100): summarize prop, meanonly
..........................................................................................................................................................................
In R, you can do as follows using boot
package and mtcars data:
library(boot)
set.seed(123)
x<-mtcars$vs
myprop<-function(x,i){
sum(x[i]==0)/length(x)
}
bootprop <- boot(x,myprop,100)