# Compare means

Contents Compare the means of a variable in different groups of a data table.

## Details

The arithmetic mean of a set of values is calculated by summing the values together and dividing the result by the total number of values. The arithmetic mean is often used to summarise the central tendency of data but can be greatly skewed by outliers in the data. This module has a `trim` parameter which symmetrically removes a proportion of the data from each end after ordering. This can be useful to remove a small set of outliers for the calculation where a central set of data are of interest. Other more robust statistics, such as the median, may also be of interest in these cases.

Splitting the data into different groups based on the values in a categorical column of the data allows comparison of means for different subsets of data.

The standard deviation can also be calculated as a measure of how close values in the data tend to be to the mean. A low standard deviation indicates that values in the data tend to be close to the mean while a higher standard deviation indicates that the data are spread over a larger range of values.

A confidence interval can also be calculated for the mean if the data represent a sample of some larger population. The calculation for this confidence interval assumes a t distribution.

## Output

An example ouput image for the Compare means module is coming soon.

## Parameters

Variable name Required Constraints Description
test_var Yes Column Input:

Numeric, Integer

The column with numeric values from which to find the mean
group_var Yes Column Input:

Text, Integer, Boolean, Date, DateTime

A categorical column from which to create groups to compare
trim Yes Decimal between 0 and 0.5 The proportion of observations to be trimmed from each end of the values in each group of `test_var` before computing the results. Default 0
remove_na Yes Boolean Whether to remove missing `NA` values from the data before computing the results.
standard_deviation Yes Boolean Whether to also calculate the standard deviations for each group of the selected column.
confidence_interval No Decimal between 0.5 and 1 If specified then the standard error and a confidence interval will be calculated for each mean.
round_digits No An Integer between -10 and 10 The number of decimal places to round the results to. Negative values indicate rounding to powers of 10 e.g. -2 will round to the nearest 100
{"ft_lang_label":"__label__en","ft_lang_prob":0.811425,"math_prob":0.9704447,"size":2438,"snap":"2020-24-2020-29","text_gpt3_token_len":504,"char_repetition_ratio":0.12489729,"word_repetition_ratio":0.014742015,"special_character_ratio":0.20426579,"punctuation_ratio":0.06787331,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99784523,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-07-16T14:49:31Z\",\"WARC-Record-ID\":\"<urn:uuid:99172706-3cc8-421c-8b12-31c40ef3620a>\",\"Content-Length\":\"38798\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:01938e4c-4842-4c9a-b4cf-4f836315afd2>\",\"WARC-Concurrent-To\":\"<urn:uuid:ed14584c-f883-4e3c-80fa-247519a43892>\",\"WARC-IP-Address\":\"13.95.95.184\",\"WARC-Target-URI\":\"https://knowledgebase.aridhia.io/article/compare-means/\",\"WARC-Payload-Digest\":\"sha1:AMVUBSCI5SGRZHZ2ZL7RXZEZP4F36SPW\",\"WARC-Block-Digest\":\"sha1:OI7IUJEQNVLQ5MRA4JAN5R7NS4UMYMJ4\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-29/CC-MAIN-2020-29_segments_1593657169226.65_warc_CC-MAIN-20200716122414-20200716152414-00202.warc.gz\"}"}