def aggregate_sternberg(data, sub_num, response_type='full'):
    """
    Aggregate data from the Sternberg task.

    Calculates various summary statistics for the Sternberg task for a 
    given subject.

    Parameters
    ----------
    data : dataframe
        Pandas dataframe containing a single subjects trial data for the task.
    sub_num : str
        Subject number to which the data file belongs.
    response_type : {'full', 'correct', 'incorrect'}, optional
        Should the summary data be calculated using all trials? Only correct 
        trials? Or only incorrect trials? This is not supported in all tasks.

    Returns
    -------
    stats : list
        List containing the calculated data for the subject.
    """
    df = data
    follow_error_rt = df.loc[df.correct.shift() == 0, 'RT'].mean()
    follow_correct_rt = df.loc[df.correct.shift() == 1, 'RT'].mean()
    if response_type == 'correct':
        df = data[data['correct'] == 1]
    elif response_type == 'incorrect':
        df = data[data['correct'] == 0]
    elif response_type == 'full':
        df = data
    grouped_set_size = df.groupby('setSize')
    set_2_rt = grouped_set_size.mean().get_value(2, 'RT')
    set_2_rtsd = grouped_set_size.std().get_value(2, 'RT')
    set_2_rtcov = set_2_rtsd / set_2_rt
    set_2_correct = grouped_set_size.sum().get_value(2, 'correct')
    set_6_rt = grouped_set_size.mean().get_value(6, 'RT')
    set_6_rtsd = grouped_set_size.std().get_value(6, 'RT')
    set_6_rtcov = set_6_rtsd / set_6_rt
    set_6_correct = grouped_set_size.sum().get_value(6, 'correct')
    intercept, slope = set_2_rt, set_6_rt - set_2_rt
    slope_norm = slope / set_2_rt
    return [sub_num, follow_error_rt, follow_correct_rt, set_2_rt, set_6_rt,
        set_2_rtsd, set_6_rtsd, set_2_rtcov, set_6_rtcov, set_2_correct,
        set_6_correct, intercept, slope, slope_norm]
