powered by
Computes the weighted variance of a numeric vector.
weighted.var(x, w, na.rm = TRUE)
Scalar containing the variance
(numeric vector) Variable of interest for which to compute the variance
(numeric vector) Vector with weights
(bool) if TRUE: Excludes missing values before computing the variance
data(df_talis18) weighted.var(df_talis18$TT3G02, df_talis18$TRWGT1)
Run the code above in your browser using DataLab