n_mean_var: Compute n, mean and variance

n_mean_varR Documentation

Compute n, mean and variance

Description

Available for numeric, integer, and factor objects. character objects are handled by first converting to a factor.

Usage

n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

## S4 method for signature 'numeric,missing'
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

## S4 method for signature 'numeric,numeric'
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

## S4 method for signature 'integer,missing'
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

## S4 method for signature 'integer,numeric'
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

## S4 method for signature 'logical,missing'
n_mean_var(x, na.rm = FALSE, unwgt.var = TRUE)

## S4 method for signature 'logical,numeric'
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

## S4 method for signature 'factor,missing'
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

## S4 method for signature 'factor,numeric'
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

## S4 method for signature 'character,missing'
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

## S4 method for signature 'character,numeric'
n_mean_var(x, w = NULL, na.rm = TRUE, unwgt.var = TRUE)

Arguments

x

a vector of values

w

an optional vector of numeric weights

na.rm

passed to sum

unwgt.var

Use unweighted or weighted covariance matrix

Value

a list containing mean and var


smd documentation built on May 29, 2024, 3:10 a.m.