#ToothGrowth data (supplied by R)
#bootstrap mean of a single numeric variable
boot(ToothGrowth$len)
#bootstrap difference in mean of tooth length for two groups.
boot(ToothGrowth$len, ToothGrowth$supp, B = 1000)
#same as above using formula syntax
boot(len ~ supp, data = ToothGrowth, B = 1000)
Run the code above in your browser using DataLab