CAM | R Documentation |
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.
CAM(x)
x |
: A binary matrix or data frame containing the responses of |
It calculates the CAM based on the following equation,
{CAM}_{ij}=\ \frac{∑_{k=1}^n x_{ki} x_{kj} / n}{∑_{k=1}^n x_{kj} /n} = \frac{∑_{k=1}^n x_{ki} x_{kj} }{∑_{k=1}^n \ x_{kj} }, \ {for}\ i\neq j.
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.
Spyros E. Balafas (s.balafas@rug.nl)
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.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.