normalized: Normalize raw scores as ratio of score to wtd mean

View source: R/normalized.R

normalizedR Documentation

Normalize raw scores as ratio of score to wtd mean

Description

Provides a data.frame that takes the matrix or data.frame and finds the weighted mean of each column and then divides each column of values by the column's weighted mean.

Usage

normalized(df, wts = NULL, na.rm = TRUE)

Arguments

df

numeric Data.frame of one or more columns of values to be normalized, or matrix or vector to be coerced to data.frame

wts

numeric Weights to use when computing weighted mean of given column, one weight per row in df (default=1) or per element of vector df. If omitted, default is unweighted mean.

na.rm

logical Whether to exclude rows where weight or value or both = NA.

Details

Uses scale()

Value

matrix same size as df, but with all values in given column divided by weighted mean of that column

See Also

scale()

Examples

## Not run: 
 mydf_norm <- tbd
 ## #

## End(Not run)

ejanalysis/analyze.stuff documentation built on April 2, 2024, 10:10 a.m.