data_coverage#
- pyfcirt.data_coverage(
- data: Model | PreparedInputs,
- *,
- by: Literal['model', 'block', 'item'] = 'model',
- details: bool = False,
Count administrations, recorded answers and likelihood events before fitting.
Parameters#
data: Model or PreparedInputsPrepared design and responses. A posterior is optional.
by: {“model”, “block”, “item”}Group units by model/response format (default), or give one row per block or item. Block and item views select the corresponding channel.
details: boolInclude response support, link, refusal and nonadministration counts, and likelihood-event count. Default:
False.
Returns#
- pandas.DataFrame
Index is
model_response_format,blockoritem. Counts include people and answered or missing administrations. People appearing in several units of a model group are counted once. Withdetails=True:n_response_categoriescounts possible answers to the original task.n_categoriescounts outcomes per encoded likelihood factor. Multiple support sizes appear as a tuple. Both category counts are missing for Beta responses.n_obscounts likelihood events, which may outnumber answered blocks.
Examples#
import pyfcirt as fc
example = fc.load_example("tirt_study", model="TIRT", n_persons=3)
model = fc.Model().prepare(example.data)
summary = fc.data_coverage(model, by="block", details=True)
columns = ["n_answered", "n_response_categories", "n_categories", "n_obs"]
print(summary.loc[["B1"], columns].to_string())
n_answered n_response_categories n_categories n_obs
block
B1 3 2 2 9
See also#
response_data() to inspect individual rows.