This function is analogue to `weighted.mean`

.

1 | ```
weighted.var(x, w, na.rm = FALSE)
``` |

`x` |
a vector with data |

`w` |
positive weights (may not have missings where |

`na.rm` |
if |

The weights *w* are standardised such that *∑_{observed} w_i* equals the number of observed values in *x*. The function calculates

*∑_{observed} w_i (x_i-weighted.mean(x,w,na.rm=T))^2/((∑_{observed} w_i)-1).*

The weighted variance of *x* with weights *w* (with missing values removed when `na.rm=TRUE`

).

Beat Hulliger

See Also as `weighted.mean`

1 2 3 4 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.