Hi everyone.
How do I get the weighted mean for x1, x2, and x3? w1 has the weights.
Can you provide me with the code?
x1 <- c(9, 5, 2, 7, 3, 6, 4, 5)
x2 <- c(8, 5, 2, 4, 3, 6, 9, 5)
x3<-c(12, 6, 2, 3, 3, 6, 8, 4)
w1 <- c(2, 3, 1, 5, 7, 1, 3, 7)
group <- c("A", "B", "A", "C", "C", "A", "B", "B")
data <- data.frame(x1, x2, x3, w1, group)
Thanks.
yoyong