Can we use apply function and BiCopselect? I am trying to avoid loop in applying BiCopselect but I have not figured it out yet. Assuming I have a dataset of 3 variables, and I want to run this function for every pair. Can anyone suggest any other way to do other than loop?
This is how I do it manually
coptest12=BiCopSelect(rankresi[,1], rankresi[,2], familyset = NA)
coptest13=BiCopSelect(rankresi[,1], rankresi[,3], familyset = NA)
coptest14=BiCopSelect(rankresi[,1], rankresi[,4], familyset = NA)
coptest15=BiCopSelect(rankresi[,1], rankresi[,5], familyset = NA)
coptest23=BiCopSelect(rankresi[,2], rankresi[,3], familyset = NA)
coptest24=BiCopSelect(rankresi[,2], rankresi[,4], familyset = NA)
coptest25=BiCopSelect(rankresi[,2], rankresi[,5], familyset = NA)
and so on until the last code:
coptest45=BiCopSelect(rankresi[,4], rankresi[,5], familyset = NA)
I just tried to use apply function, but it does not seem possible as if I used:
sapply(rankresi, BiCopSelect)
the error will be "missinig u1 and u2 for BiCopSelect"