sample_var: Compute the sample variance

View source: R/sample_var.R

sample_varR Documentation

Compute the sample variance

Description

sample_var computes the sample variance, i.e. the sum of squared deviations of x from the mean divided by the total number of observations. This is in contrast to var, which computes an unbiased estimate of the variance (i.e. it divides the sum of squared deviations by n - 1).

Usage

sample_var(x, na.rm = FALSE)

Arguments

x

Numeric vector

na.rm

(logical) Should missing values be removed?

Value

A single numeric value equal to the sample variance

Examples

data(anchoring)
sample_var(anchoring$everest_feet)

sdamr documentation built on Nov. 17, 2022, 1:06 a.m.