Single mean

Calculate the mean of the values in a column 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.

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 the t-distribution.

Output

The example below shows how to compute the arithmetic mean of CO2 uptake in plants using the Single Mean module. The output also includes standard deviation, standard error and the 95% confidence interval.

single_mean.gif

Parameters

Variable nameRequiredConstraintsDescription
test_varYesColumn Input: Numeric, IntegerThe column with numeric values from which to find the mean.
trimYesDecimal between 0 and 0.5The proportion of observations to be trimmed from each end of the values in test_var before computing the results. Default is 0.
remove_naYesBooleanWhether to remove missing NA values from the data before computing the mean.
standard_deviationYesBooleanWhether to also calculate the standard deviation for the selected column.
confidence_intervalNoDecimal between 0.5 and 1If specified then the standard error and a confidence interval will be calculated for the mean.
round_digitsNoAn Integer between -10 and 10The number of decimal places to round the result to. Negative values indicate rounding to powers of 10 e.g. -2 will round to the nearest 100.

See Also

Updated on November 2, 2022

Was this article helpful?