def chance_adjusted_agreement(observed_agreement, chance_agreement):
    """Return the chance-adjusted agreement given the specified agreement
    and expected agreement.

    Defined by (observed_agreement - chance_agreement)/(1.0 - chance_agreement)

    Arguments
    ---------
    observed_agreement : float
        Agreement computed from the data

    chance_agreement : float
        Agreement expected by chance give the assumptions of the statistics

    Return
    ------
    result : float
        Chance adjusted agreement value
    """
    return (observed_agreement - chance_agreement) / (1.0 - chance_agreement)
