mcfa {cfa} | R Documentation |
Determines the frequency of all combinations of variable values (their configurations) over time or with and without treatment in comparison with their expected frequency and displays them in the order of decreasing chi-squared. In addition, a global chi squared is calculated.
mcfa(configmatrix, cntmatrix, descending=TRUE, sortonchisq=TRUE, ignore.na=FALSE, verbose=FALSE)
configmatrix |
Dataframe with the variables to be analyzed |
cntmatrix |
Matrix with >=2 columns of counts (containing 1 if the data are not aggregated) |
descending |
Output in the order of decreasing chi squared |
sortonchisq |
Sort output on chi squared |
ignore.na |
Ignore (casewise) missing data in the configurations |
verbose |
Long output |
Each variable must have at least two different values and may have more
(extension of the classical CFA). The configmatrix
must consist of at least
two variables (columns). Factors and numbers are both accepted (the numbers
are internally converted to factors). The cntmatrix
must be
numeric.
Counts should be at least = 5 for the chi squared test to be reliable but when
using the CFA as a purely heuristic tool counts of 0 are possible.
A list with class "mcfa"
contains the tabular results and the overall parameters
Row names |
Configuration |
n(1)..n(configs) |
Frequency (count) of this configuration |
expected(1)..expected(config) |
Expected Frequency (count) of this configuration |
chi.sq |
Chi squared for the given configuration |
p(chisq) |
p(chi squared) for the given configuration |
Overall chi squared |
Overall chi squared |
p(chi squared) |
p(overall chi squared) |
Degrees of freedom |
Overall degrees of freedom |
The program is implemented in R itself rather than a
compiled library and therefore slow. In most cases the input is a
pre-aggregated table and speed is no problem because the configmatrix
is small. There are no hard-coded limits in the program so even large tables
can be processed but this will take time and memory.
The outout table can be very wide if the levels of the factors variables are
long so options(width=..)
may need to be adjusted
Stefan Funke <funke@attglobal.net>
Krauth J., Lienert G. A. (1973, Reprint 1995) Die Konfigurationsfrequenzanalyse (KFA) und ihre Anwendung in Psychologie und Medizin Beltz Psychologie Verlagsunion
Eye, A. von (1990) Introduction to configural frequency analysis. The search for types and anti-types in cross-classification. Cambride 1990
library(cfa) data(cfa2dat) mcfa(cfa2dat[1:3],cfa2dat[4:5],verbose=T)