{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Swedish SAT example\n", "Here we provide a usage example of the IRTorch package using a sample of data from the Swedish scholastic aptitude test (SAT). The test is used for admission to university programs and consists solely of multiple choice items. It has a quantitative and a verbal part. In this example, we will analyze the quantitative part. We will not do an in-depth analysis of the data, but rather showcase some of the main features of IRTorch to enable the user to analyze their own data.\n", "\n", "Users are referred to the API reference section of the documentation for more detailed information of different functions and classes. Note that the results might vary slightly from those presented here due to differences in the computing hardware (CPU or GPU), the operating system, and the versions of the packages used.\n", "\n", "If you prefer to run the code directly, you can download this example Jupyter notebook from the [GitHub repository](https://github.com/joakimwallmark/irtorch/blob/main/docs/source/notebooks/swedish_sat.ipynb)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Load the libraries\n", "We start by loading the libraries and modules that we will use for this example." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "import copy\n", "import torch\n", "import irtorch\n", "from irtorch.models import NestedLogit, ThreeParameterLogistic\n", "from irtorch.estimation_algorithms import MML" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
| \n", " | a1 | \n", "b | \n", "c | \n", "
|---|---|---|---|
| 0 | \n", "1.966666 | \n", "0.828008 | \n", "0.251554 | \n", "
| 1 | \n", "0.916558 | \n", "-0.139290 | \n", "0.022015 | \n", "
| 2 | \n", "1.679640 | \n", "-0.469832 | \n", "0.141211 | \n", "
| 3 | \n", "0.872167 | \n", "1.546278 | \n", "0.208094 | \n", "
| 4 | \n", "2.076665 | \n", "0.829094 | \n", "0.293600 | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "
| 75 | \n", "1.380502 | \n", "1.361326 | \n", "0.151783 | \n", "
| 76 | \n", "2.575020 | \n", "0.050730 | \n", "0.216261 | \n", "
| 77 | \n", "1.108828 | \n", "0.514778 | \n", "0.078823 | \n", "
| 78 | \n", "1.827466 | \n", "0.557874 | \n", "0.120996 | \n", "
| 79 | \n", "0.897126 | \n", "0.155884 | \n", "0.217186 | \n", "
80 rows × 3 columns
\n", "