---
title: "Getting Started with exametrika"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Getting Started with exametrika}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.width = 7,
  fig.height = 5,
  out.width = "100%"
)
```

## Overview

The `exametrika` package provides comprehensive Test Data Engineering tools for analyzing educational test data. Based on the methods described in Shojima (2022), this package enables researchers and practitioners to:

- Analyze test response patterns and item characteristics
- Classify respondents using various psychometric models
- Investigate latent structures in test data
- Examine local dependencies between items
- Perform network analysis of item relationships

## Installation

```{r install, eval=FALSE}
# Install from CRAN
install.packages("exametrika")

# Or install the development version from GitHub
if (!require("devtools")) install.packages("devtools")
devtools::install_github("kosugitti/exametrika")
```

## Data Format

```{r library, message=FALSE, warning=FALSE}
library(exametrika)
```

### Data Requirements

Exametrika accepts both binary and polytomous response data:

- **Binary data** (0/1): 0 = incorrect, 1 = correct
- **Polytomous data**: ordinal response categories or multiple score levels
- **Missing values**: NA values supported; custom missing value codes can be specified

### Data Formatting

The `dataFormat()` function processes input data before analysis:

```{r example-data-format}
# Format raw data for analysis
data <- dataFormat(J15S500)
str(data)
```

### Sample Datasets

The package includes sample datasets from Shojima (2022). The naming convention is `JxxSxxx` where J = number of items and S = sample size.

| Dataset | Items | Examinees | Type | Use Case |
|---------|------:|----------:|------|----------|
| J5S10 | 5 | 10 | Binary | Quick testing |
| J5S1000 | 5 | 1,000 | Ordinal | GRM examples |
| J12S5000 | 12 | 5,000 | Binary | LDLRA examples |
| J15S500 | 15 | 500 | Binary | IRT, LCA examples |
| J15S3810 | 15 | 3,810 | Ordinal (4-point) | Ordinal LRA |
| J20S400 | 20 | 400 | Binary | BNM examples |
| J20S600 | 20 | 600 | Nominal (4-cat) | Nominal Biclustering |
| J35S500 | 35 | 500 | Ordinal (5-cat) | Ordinal Biclustering |
| J35S515 | 35 | 515 | Binary | Biclustering, network models |
| J35S5000 | 35 | 5,000 | Multiple-choice | Rated LRA |
| J50S100 | 50 | 100 | Binary | Small sample testing |

## Basic Statistics

### Test Statistics

```{r test-statistics, message=FALSE, warning=FALSE}
TestStatistics(J15S500)
```

### Item Statistics

```{r item-statistics, message=FALSE, warning=FALSE}
ItemStatistics(J15S500)
```

### Classical Test Theory

```{r ctt, message=FALSE, warning=FALSE}
CTT(J15S500)
```

## Next Steps

- [Item Response Theory](irt.html): IRT and GRM models
- [Latent Class and Rank Analysis](latent-class-rank.html): LCA and LRA
- [Biclustering](biclustering.html): Biclustering, Ranklustering, and IRM
- [Network Models](network-models.html): BNM, LDLRA, LDB, and BINET

## Reference

Shojima, Kojiro (2022) *Test Data Engineering: Latent Rank Analysis, Biclustering, and Bayesian Network* (Behaviormetrics: Quantitative Approaches to Human Behavior, 13), Springer.
