stirling_cfa {confreq} | R Documentation |
Approximation to the binomial using Stirling's Formula
Description
Calculates the binomial aproximation using stirling's formula (Version of function: V 1.0 - November 2013)
Usage
stirling_cfa(
observed,
expected = NULL,
n = sum(observed),
p = NULL,
cum = T,
verb = T
)
Arguments
observed |
a integer vector with observed freqencies |
expected |
a vector giving the expected frequencies. expected can be set to |
n |
number of trials (scalar) default is |
p |
a vector of cell probabilities. If p is not NULL the argument |
cum |
a logical - computation of cumulative density. If |
verb |
logical - verbose results: If |
Details
Vector p must be of same length as observed _or_ p may be a scalar (e.g. in case of the zero-order CFA).
-
The routine autoselects the upper or lower tail:
if obs > exp then sum obs:n
else sum 0:obs
-
The stirling approximation cannot be evaluated if the observed frequency is 0 or n. Therefore, the proposal of A. von Eye (20xx) is adopted, taking the sum up to 1 or n-1, respectively.
Author(s)
R.W. Alexandrowicz
References
von Eye, A. (2002). Configural Frequency Analysis. Methods, Models, and Applications. Mahwah, NJ, LEA.