d-pac.functions
Installation
$ npm install d-pac.functions
Usage
const funx = ; funxstat; //100funxpm;// 0.9158064516129032
const stat = ;stat; //100
const pm = ;pm;// 0.9158064516129032
API
pm
reliability
Overall consistency of a measure
Parameters
Examples
pm; //0.75
Returns number The reliability
reliabilityFunctor
Creates a function by taking two getters, which can be used to calculate the reliability of a set of values and SE's
Parameters
Examples
const list = v:1 se:4 v:2 se:2 v:3 se:0 v:5 se:045 v:8 se:3;const f = pm;; //0.05186688311688284
Returns Function Function to be used on a list to calculate the reliability
rasch
Rasch probability or Bradley-Terry-Luce probability
Parameters
Examples
pm; //0.401312339887548
Returns number The Rasch probability
fisher
Fisher information
Parameters
aF
number param AbF
number param Bdigits
number? number of digits to appear after the decimal point
Examples
pm; //0.24026074574152914
pm; //0.2403
Returns number The fisher information
stat
square
Squares a number
Parameters
value
Number a value
Examples
stat; //100
Returns Number the squared value
sum
Addition of a sequence of numbers - ∑
Parameters
collection
Array set of numbers (optional, default[]
)f
Function? (optional) function used to retrieve the value (optional, defaultreturnValue
)
Examples
stat; //19
stat; //19
Returns Number the sum of all values
mean
Arithmetic mean, sum of a sequence of numbers divided by sequence length
Parameters
collection
Array set of numbers (optional, default[]
)f
Function? (optional) function used to retrieve the value (optional, defaultreturnValue
)
Examples
stat; //3.8
stat; //3.8
Returns Number the arithmetic mean
variance
The distance between numbers in a set
Parameters
collection
Array set of numbers (optional, default[]
)f
Function? (optional) function used to retrieve the value (optional, defaultreturnValue
)
Examples
stat; //6.16
stat; //6.16
Returns Number the distance between numbers in a set
sd
Standard deviation - σ
Parameters
collection
Array set of numbers (optional, default[]
)f
Function? (optional) function used to retrieve the value (optional, defaultreturnValue
)
Examples
stat; //2.4819347291981715
stat; //2.4819347291981715
Returns Number the standard deviation
rms
Root mean square, quadratic mean
Parameters
collection
Array set of numbers (optional, default[]
)f
Function? (optional) function used to retrieve the value (optional, defaultreturnValue
)
Examples
stat; //4.538722287164087
stat; //4.538722287164087
Returns Number the root mean square
median
Returns the median of the set
Parameters
collection
Array set of numbers (optional, default[]
)f
Function? (optional) function used to retrieve the value (optional, defaultreturnValue
)
Examples
stat; //3
stat; // 3
Returns Number the median
standardize
calculate standard scores of z scores: z= (x - mu)/sigma
Parameters
collection
Array set of numbers (optional, default[]
)getter
Function? (optional) function used to retrieve the value (optional, defaultreturnValue
)setter
Function? (optional) function used to set the standardized value. Obviously could have side-effects when used. (optional, defaultnull
)
Examples
stat;// [ 0.4326093777237974, 0.5184161964458729, 0.918848017148892, 0.23239346737228786, 0.4612116506311559, -2.4848224588267702, -0.39685653658959924, 0.31820028609436335 ]
stat;// [ 0.4326093777237974, 0.5184161964458729, 0.918848017148892, 0.23239346737228786, 0.4612116506311559, -2.4848224588267702, -0.39685653658959924, 0.31820028609436335 ]