plot_response_distribution#

pyfcirt.plot_response_distribution(
summary: DataFrame,
*,
statistic='proportion',
**kwargs,
)#

Plot observed category proportions or counts.

Parameters#

summary : pandas.DataFrame

Table from response_counts() or the long responses from response_data().

statistic : {“proportion”, “count”}

Bar height. Default: "proportion".

kwargs

Seaborn catplot() options such as height and col_wrap. An optional hue names a grouping column. Category axes are local.

Returns#

seaborn.axisgrid.FacetGrid

One panel per applicable unit, pair and group. Edit its axes with Seaborn or Matplotlib.

Examples#

Compare observed preferences within each pair of block B1.

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"])
counts = fc.response_counts(answers)
grid = fc.plot_response_distribution(counts, height=2.6)
Observed category proportions for each of the three pairs of B1.

See also#

Summaries and plotting.