Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- factor <- factor(cut(var1, quantile(var1, seq(0,1,0.1))))
- var2_split = split(vat2, factor)
- weight_split = split(weight, factor)
- sapply(var2_split, weighted.mean, weight_split)
- Error in FUN(X[[1L]], ...) : 'x' and 'w' must have the same length
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement