def get_stat_output(args, first_year, stats_dict, top_words, data_list):
    """
        Function to format output statistics for one subset of corpus between
        first_year and first_year + args.year_split.

        input:
            args (argparse object): input arguments
            first_year (int): start year of this time slice
            stats_dict (dict): dictionary containing calculated statistics
            top_words (list): list of top words
            data_list (list): list of titles of all statistics found

        return list that is a row in output tsv file when joined by tabs
    """
    ret = [first_year]
    for count in data_list:
        # This tag isn't a percentage
        if count == "num_entities" or count == "total" or count == "proper_nouns":
            ret.append(stats_dict[count])
        elif count == "top_" + str(args.num_top_words) + "_words":
            ret.append(", ".join(top_words))
        # Divide percentages by total
        else: ret.append(round(stats_dict[count]/stats_dict["total"], 4))

    return ret