catdap1 {catdap}  R Documentation 
Calculates the degree of association between all the possible pairs of categorical variables.
catdap1(cdata, response.names = NULL, plot = 1, ask = TRUE) catdap1c(ctable, response.names = NULL, plot = 1, ask = TRUE)
cdata 
categorical data matrix with variable names on the first row. 
ctable 
crosstabulation table with a list of variable names. 
response.names 
variable names of response variables. If 
plot 
split directions for each level of the mosaic:

ask 
logical; if 
This function is an Rfunction style clone of Sakamoto's CATDAP01 program for categorical data analysis. CATDAP01 calculates the degree of association between all the possible pairs of categorical variables.
The degree of association is evaluated by AIC value. See help(catdap2) for details about AIC.
catdap2
should be used when the best subset and categorization
of explanatory variables are sought for. Continuous explanatory variables
could be explanatory variables in case of catdap2.
tway.table 
twoway tables and ratio. 
total 
total number of data with corresponding code of variables. 
aic 
AIC's of explanatory variables for each response variable. 
aic.order 
list of explanatory variable numbers arranged in ascending order of AIC. 
Y.Sakamoto and H.Akaike (1978) Analysis of CrossClassified Data by AIC. Ann. Inst. Statist. Math., 30, pp.185197.
K.Katsura and Y.Sakamoto (1980) Computer Science Monograph, No.14, CATDAP, A Categorical Data Analysis Program Package. The Institute of Statistical Mathematics.
Y.Sakamoto, M.Ishiguro and G.Kitagawa (1983) Information Statistics Kyoritsu Shuppan Co., Ltd., Tokyo. (in Japanese)
Y.Sakamoto (1985) Categorical Data Analysis by AIC. Kluwer Academic publishers.
## example 1 (The Japanese National Character) data(JNcharacter) response < c("born.again", "difficult", "pleasure", "women.job", "money") catdap1(JNcharacter, response) # or, simply data(JNcharacter) catdap1(JNcharacter) ## example 2 (Titanic data) # A data set with 2201 observations on 4 variables (Class, Sex, Age and Survived) # crosstabulating data catdap1c(Titanic, "Survived") # individual data x < data.frame(Titanic) y < data.matrix(x) n < dim(y)[1] nc < dim(y)[2] z < array(, dim = c(nc1, sum(y[, 5]))) k < 1 for (i in 1:n) if (y[i, nc] != 0) { np < y[i, nc] for (j in 1:(nc1)) z[j, k:(k+np1)] < dimnames(Titanic)[[j]][[y[i, j]]] k < k + np } data < data.frame(aperm(array(z, dim = c(4,2201)), c(2,1)), stringsAsFactors = TRUE) names(data) < names(dimnames(Titanic)) catdap1(data, "Survived")