wt.var: Function that calculates a weighted variance

Description Usage Arguments Value Source Examples

View source: R/refitME_package.r

Description

This function that calculates a weighted variance for a given vector.

Usage

1
wt.var(x, w)

Arguments

x

: a vector of numerical data.

w

: a vector of equal length to x representing the weights.

Value

wt.var returns a single value from analysis requested.

Source

The developer of this function is Jeremy VanDerWal. See https://rdrr.io/cran/SDMTools/src/R/wt.mean.R

Examples

1
2
3
4
5
6
7
# Define simple data
x = 1:25 # Set of numbers.
wt = runif(25) # Some arbitrary weights.

# Display variances (unweighted and then weighted).
var(x)
wt.var(x, wt)

refitME documentation built on Aug. 3, 2021, 5:07 p.m.