npar.CDM {ACTCD} | R Documentation |

## Main function for ACTCD package

### Description

This function is used to classify examinees into labeled classes given responses and the Q-matrix.

### Usage

```
npar.CDM(Y, Q, cluster.method = c("HACA", "Kmeans"), Kmeans.centers = NULL,
Kmeans.itermax = 10, Kmeans.nstart = 1, HACA.link = c("complete", "ward", "single",
"average", "mcquitty", "median", "centroid"), HACA.cut = NULL, label.method =
c("2b", "2a", "1", "3"),perm=NULL)
```

### Arguments

`Y` |
A required |

`Q` |
A required |

`cluster.method` |
The cluster algorithm used to classify data. Two options are available, including |

`Kmeans.centers` |
The number of clusters when |

`Kmeans.itermax` |
The maximum number of iterations allowed when |

`Kmeans.nstart` |
The number of random sets to be chosen when |

`HACA.link` |
The link to be used with HACA. It must be one of |

`HACA.cut` |
The number of clusters when |

`label.method` |
The algorithm used for labeling. It should be one of "1","2a", "2b" and "3" corresponding to different labeling methods in Chiu and Ma (2013). The default is "2b". See |

`perm` |
The data matrix of the partial orders of the attribute patterns. |

### Value

`att.pattern` |
A |

`att.dist` |
A |

`cluster.size` |
A set of integers, indicating the sizes of latent clusters. |

`cluster.class` |
A vector of estimated memberships for examinees. |

### See Also

`print.npar.CDM`

, `cd.cluster`

,`labeling`

### Examples

```
# Classification based on the simulated data and Q matrix
data(sim.dat)
data(sim.Q)
# Information about the dataset
N <- nrow(sim.dat) #number of examinees
J <- nrow(sim.Q) #number of items
K <- ncol(sim.Q) #number of attributes
# Compare the difference in results among different labeling methods
# Note that the default cluster method is HACA
labeled.obj.2a <- npar.CDM(sim.dat, sim.Q, label.method="2a")
labeled.obj.2b <- npar.CDM(sim.dat, sim.Q, label.method="2b")
labeled.obj.3 <- npar.CDM(sim.dat, sim.Q, label.method="3")
data(perm3)
labeled.obj.1 <- npar.CDM(sim.dat, sim.Q, label.method="1",perm=perm3)
remove(perm3)
#User-specified number of latent clusters
M <- 5
labeled.obj.2b <- npar.CDM(sim.dat, sim.Q, cluster.method="HACA",
HACA.cut=M, label.method="2b")
labeled.obj.2a <- npar.CDM(sim.dat, sim.Q, cluster.method="HACA",
HACA.cut=M, label.method="2a")
#The attribute pattern for each examinee
attpatt <- labeled.obj.2b$att.pattern
```

*ACTCD*version 1.3-0 Index]