Learn R Programming

mudfold (version 1.1.21)

CAM: Conditional adjacency matrix (CAM) for dichotomously scored items.

Description

This function is used to calculate the conditional adjacency matrix (CAM) from a binary valued matrix with the responses of n individuals to N items (Post,1992). CAM in its (i,j)th element contains the conditional frequency that a subject from the sample will choose the row item i given that the column item j is chosen. The probability \(Pr(X_i=1 | X_j=1)\) is estimated from the data by dividing the joint frequency of choosing both items i and j by the relative frequency of choosing item j. Different orderings of the columns of the input matrix will result into different CAM matrices.

Usage

CAM(x)

Value

A matrix of class 'cam.mdf', with ncol(x) rows and ncol(x) columns with missing values on the diagonal elements when x is a matrix or data frame. When x is an object of class "mdf" the dimension of the output matrix depends on the length of the obtained MUDFOLD scale. Rows and columns of the resulting CAM are ordered in the order of the columns of x when x is a matrix. When x is a fitted MUDFOLD object then the rows and columns of CAM are ordered in the obtained MUDFOLD order.

Arguments

x

: A binary matrix or data frame containing the responses of nrow(data) persons to ncol(data) items. In this case, missing values in x are not allowed. Alternatively, x can be a fitted object of class "mdf" from the mudfold() function. Then the function will extract the CAM for the obtained MUDFOLD scale.

Author

Spyros E. Balafas (s.balafas@rug.nl)

Details

It calculates the CAM based on the following equation,

\( {CAM}_{ij}=\ \frac{\sum_{k=1}^n x_{ki} x_{kj} / n}{\sum_{k=1}^n x_{kj} /n} = \frac{\sum_{k=1}^n x_{ki} x_{kj} }{\sum_{k=1}^n \ x_{kj} }, \ {for}\ i\neq j. \)

References

W.J. Post. (1992). Nonparametric Unfolding Models: A Latent Structure Approach. M & T series. DSWO Press.

W.J. Post. and T.AB. Snijders. (1993). Nonparametric unfolding models for dichotomous data. Methodika.

Examples

Run this code
## load the ANDRICH data
data("ANDRICH")

## Calculate the CAM for the ANDRICH scale
CAM_andrch <- CAM(ANDRICH)

## Extract CAM from a fitted mudfold object 
mudf_andrich <- mudfold(ANDRICH)
CAM_andrch_mudfold <- CAM(mudf_andrich)

Run the code above in your browser using DataLab