This function takes in a selected metric and uses z-score (number of standard deviations) to identify and remove outlier weeks for individuals across time. There are applications in this for removing weeks with abnormally low collaboration activity, e.g. holidays. Retains metrics with z > -2.

Function is based on identify_outlier(), but implements a more elaborate approach as the outliers are identified and removed with respect to each individual, as opposed to the group. Note that remove_outliers() has a longer runtime compared to identify_outlier().

remove_outliers(data, metric = "Collaboration_hours")



A Standard Person Query dataset in the form of a data frame.


Character string containing the name of the metric, e.g. "Collaboration_hours"


Returns a new data frame, "cleaned_data" with all metrics, having removed the person-weeks that are below 2 standard deviations of each individual's collaboration activity.


For mature functions to remove common outliers, please see the following:


Mark Powers mark.powers@microsoft.com