How can I compute the weighted standard deviation per game round? The dataframe is in reality quite wide (with many players: from r001 up to r100), and long (many game rounds). The weights differ per game round.
df <- data.frame(gameround= c("1_1", "1_2", "1_3"),
r001 = c(3,5,4), r002 = c(2,3,5), r003 = c(1,2,2), weight001=c(0.7,0.8,0.7),
weight002 = c(0.6,0.1,0.6), weight003=c(0.2,0.7,0.2) ,weightedsd = NA)
#gameround r001 r002 r003 weight001 weight002 weight003 weightedsd
# 1_1 3 2 1 0.7 0.6 0.2 NA
# 1_2 5 3 2 0.8 0.1 0.7 NA
# 1_3 4 5 2 0.7 0.6 0.2 NA