I am a uni student doing stats, currently looking at creating functions in r. I really struggle with functions and am stuck on certain one I am having to create. I was wondering if someone could help me with this or lead me in the right direction.
I'm writing a function "BCa" that creates a bootstrap interval. The first argument I have to write is meant to be the statistic of interest to be bootstrapped when executed on a vector of data
For example, if I were to put 'BCa(stat=mean,...' I'd be bootstrapping the sample mean when using 'stat(...' inside your function, or 'BCa(stat=quantile,...' I'd be bootstrapping the certain quantile when using 'stat(...'
I just don't quite know how to make this argument completely take over what another function does. I'd be very appreciative if someone could help.