def convert_delay_data(data):
    """ Convert raw data (dataframe) into a new data frame with:
    x = DB
    y = RA/RB
    freq = frequency of this design
    prop = average response to each unique design
    """

    # define columns that define a unique design
    cols = ["RA", "DA", "PA", "RB", "DB", "PB"]
    # new dataframe of unique designs with additional freq count column
    new = data.groupby(cols).size().reset_index(name="freq")
    # add average response to each unique design
    new["prop"] = data.groupby(cols)["R"].mean().reset_index(name="prop")["prop"]
    new["x"] = new["DB"]
    new["y"] = new["RA"] / new["RB"]
    new = new[["x", "y", "freq", "prop"]]
    return new