def _infer_choices_with_prefix(params, prefix):
    """Infer choices with prefix.

    Examples
    --------
    >>> params = pd.Series(
    ...     index=["wage_b", "wage_white_collar", "wage_a", "nonpec_c"], dtype="object"
    ... )
    >>> _infer_choices_with_prefix(params, "wage")
    ['a', 'b', 'white_collar']

    """
    return sorted(
        params.index.get_level_values(0)
        .str.extract(fr"\b{prefix}_([A-Za-z_]+)\b", expand=False)
        .dropna()
        .unique()
    )