wt.var: Function that calculates a weighted variance

View source: R/refitME_package.r

wt.varR Documentation

Function that calculates a weighted variance

Description

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

Usage

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

# 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 April 13, 2025, 9:08 a.m.