I am trying to calculate the standard deviations for each column in a data frame. The data frame (betas_trans) has 11 columns (repurchase agreement haircuts) and 397 rows (companies). This is the code:
betas_col_SD <- matrix(NA,nrow = 1,ncol = 11)
for(i in 1:1) {
for(j in 1:11) {
betas_col_SD[i,j] <- sd(betas_trans[,1+i],betas_trans[,1+j],use = "pairwise.complete.obs")
}
}
However, I am getting an error:
Error in sd(betas_trans[, 1 + i], betas_trans[, 1 + j], use = "pairwise.complete.obs") :
unused argument (use = "pairwise.complete.obs")
Please help to fix. Thank you.