standard_score: Standardized scores

Description Usage Arguments Details Examples

View source: R/standard-scores.R

Description

Formula and base for supporting standardized scoring.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
standard_score(
  x,
  .center,
  .spread,
  st_mult = 1,
  st_add = 0,
  na.rm = FALSE,
  ...
)

z_score(
  x,
  method = c("sample", "population"),
  na.rm = FALSE,
  standardized = FALSE,
  ...
)

t_score(
  x,
  method = c("sample", "population"),
  na.rm = FALSE,
  standardized = FALSE,
  ...
)

Arguments

x

A numeric vector

.center

A function for centering

.spread

A function for spread

st_mult

A multiplier to adjust the center

st_add

A constant to add to the result

...

Additional arguments passed down to functions

method

Sample or population (partial matches acceptable)

standardized

Logical, if true uses 'sterr' rather than 'stdev' as '.spread'

Details

A general function to creating standardized scores is provides in 'standard_score()'. Two special cases, 'z_score()' and 't_score()' are provided using this template.

Examples

1
standard_score(c(1:10, NA), mean, sd, na.rm = TRUE)

jmbarbone/qpm documentation built on July 25, 2020, 10:41 p.m.