wt.var {refitME} | R 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 |
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)
[Package refitME version 1.3.1 Index]