binomial_test_cfa {confreq}R Documentation

Binomial Test

Description

Calculates the (exact) binomial test based on obseved, expected frequencies an the total number of observations.

Usage

binomial_test_cfa(observed, expected, ntotal = sum(observed))

Arguments

observed

a vector giving the observed frequencies.

expected

a vector giving the expected frequencies.

ntotal

optional a numeric giving the total number of observations. By default ntotal is calculated as ntotal=sum(observed).

Details

No details

Value

a numeric giving the p-value.

References

No references in the moment

Examples

#######################################
# first calculate 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<-expected_cfa(des=designmatrix, observed=observed) # calculation of expected counts
 binomial_test_cfa(observed,expected)
####################################### 

[Package confreq version 1.6.1-1 Index]