expected_cfa: Expected frequencies with glm

View source: R/expected_cfa.R

expected_cfaR Documentation

Expected frequencies with glm

Description

Calculates the expected frequencies of counts using log liniear model.

Usage

expected_cfa(des, observed, family = poisson(), intercept = FALSE, ...)

Arguments

des

a designmatrix (object of class "matrix") as returned by function design_cfg_cfa.

observed

a integer vector with lenght(observed) == dim(des)[1]. WARNING: The observed frequencies counts must be in an order corresponding to the coding sheme in designmatix (see argument des).

family

argument passed to glm.fit with default set to poisson()

intercept

argument passed to glm.fit with default set to FALSE

...

aditional arguments optional passed to glm.fit

Details

No details

Value

An vector object giving the expected counts.

References

No references in the moment

Examples

#######################################
# expected counts for LienertLSD data example.
designmatrix<-design_cfg_cfa(kat=c(2,2,2)) # generate an designmatrix (only main effects)
data(LienertLSD) # load example data
observed<-LienertLSD[,4] # extract observed counts
expected_cfa(des=designmatrix, observed=observed) # calculation of expected counts
####################################### 

confreq documentation built on Nov. 13, 2022, 9:05 a.m.