Learn R Programming

confreq (version 1.6.1-1)

lr: Likelihood Ratio Chi-square (LR)

Description

Calculates the likelihod ratio chi-square statistic based on observed and expected counts.

Usage

lr(observed, expected)

Value

numeric giving the likelihood ratio chi-square statistic.

Arguments

observed

a vector giving the observed frequencies.

expected

a vector giving the expected frequencies.

Details

No details in the moment.

References

Stemmler, M. (2014). Person-Centered Methods -- Configural Frequency Analysis (CFA) and Other Methods for the Analysis of Contingency Tables. Cham Heidelberg New York Dordrecht London: Springer.

Examples

Run this code
#######################################
######### some examples ########
data(newborns)
newborns
designmatrix <- design_cfg_cfa(kat=c(2,2)) # generate an designmatrix (only main effects)
observed <- newborns[,3] # extract observed counts
expected <- expected_cfa(des=designmatrix, observed=observed) # calculation of expected counts
lr(observed,expected) # calculation of the likelihood ratio chi-square statistic

Run the code above in your browser using DataLab