response_data#
- pyfcirt.response_data(
- data: Model | PreparedInputs,
- *,
- blocks=None,
- items=None,
- representation='auto',
- groups: pd.DataFrame | None = None,
Get labelled observed answers for descriptive analysis.
Parameters#
data: Model or PreparedInputsRecorded answers and design. No posterior is required.
blocks,items: sequence or NoneBlock or item IDs. Omit both to include all units.
representation: str or mapping"auto"uses pairwise rows for TIRT/GTUM and category rows for other models. Specify"pairwise"or"categories", or map individual block IDs to these choices. Items use categories.groups: pandas.DataFrame or NoneGroup columns indexed by person ID, with index named
person.
Returns#
- pandas.DataFrame
Long table with
person,blockoritem, and the observedcategorypluscategory_label. A pairwise view includes the typedpairand its preference direction inpair_label. Only answered rows appear.
Notes#
A pair label A > B means that a larger response favors A. The category column gives the recorded answer.
Examples#
Inspect the first three pair records in one triplet.
import pyfcirt as fc
bundle = fc.load_example("tirt_study", model="TIRT", n_persons=6)
model = fc.Model(bundle.data)
answers = model.response_data(blocks=["B1"])
columns = ["person", "block", "pair", "pair_label", "category"]
print(answers[columns].head(3).to_string(index=False))
person block pair pair_label category
P1 B1 (S1, S2) S1 > S2 0
P6 B1 (S1, S2) S1 > S2 0
P2 B1 (S1, S2) S1 > S2 1