• https://me.yahoo.com
COST (GBP)
0.50
0.00
0

# Avedev

Calculates the absolute deviation of a given set of data.
Controller: CodeCogs
Contents

C++

## Avedev

 template doubleavedev( int n T* data )
The absolute deviation of an element of a data set is the absolute difference between that element and a given point. Typically the point from which the deviation is measured is the value of either the median or the mean of the data set.

The average absolute deviation of a data set is the average of the absolute deviations and is a summary statistic of statistical dispersion or variability.

The average absolute deviation of a set $\inline&space;{x_1,&space;x_2&space;...,&space;x_N}$ is:

$avedev=\frac{\sum_{i=1}^N|x_i-\overline{x}|}{N}$

where $\inline&space;\overline{x}$ is the selected value of central tendency of the set about which the average absolute deviation is being measured. In general, the average absolute deviation from the mean is between one and two times the average absolute deviation from the median; it is also less than or equal to the standard deviation.

## References:

Wikipedia, http://en.wikipedia.org/wiki/Absolute_deviation

### Example 1

#include <codecogs/statistics/moments/avedev.h>
#include <iostream>
int main()
{
double x[5] = {3.4 , 7.5 , 8.5 , 0.6 , 3.9};
std::cout << "The absolute deviation is: " << adev << std::endl;
return 0;
}
Output:
The absolute deviation is:2.576

### Parameters

 n the size of the population data the actual population data given asa an array

### Returns

return value the absolute deviation of the given set of data

### Authors

Anca Filibiu (August 2005)
##### Source Code

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.