plot_response_distribution#
Plot observed category proportions or counts.
Parameters#
summary: pandas.DataFrameTable from
response_counts()or the long responses fromresponse_data().statistic: {“proportion”, “count”}Bar height. Default:
"proportion".kwargsSeaborn
catplot()options such asheightandcol_wrap. An optionalhuenames 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)