Expected frequencies with glm

Description

Calculates the expected frequencies of counts using log liniear model.

Usage

1
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

1
2
3
4
5
6
7
#######################################
# 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
#######################################