R/weighted.var.R

Defines functions weighted.var

###
### weighted variance formula
###

weighted.var <- function(x, w) 
  return(sum(w * (x - weighted.mean(x,w))^2)/((length(x)-1)*mean(w)))
  

Try the experiment package in your browser

Any scripts or data that you put into this service are public.

experiment documentation built on April 30, 2018, 5:04 p.m.