# Variable evaluation | set 1

Terms related to variability metrics:

` -" Deviation -" Variance -" Standard Deviation -" Mean Absolute Deviation -" Meadian Absolute Deviation -" Order Statistics -" Range -" Percentile -" Inter-quartile Range `
• Deviation: we can call it — errors or leftovers too. It is a measure of how different / scattered the values ​​are from the central / observed value.
Example:
` Sequence: [2, 3, 5, 6, 7, 9] Suppose, Central / Observed Value = 7 Deviation = [-5, -4, -2 , -1, 0, 2] `
• Variance (with 2 ): This is the most famous measure for assessing variability because it represents is the squared deviation. This can be called the root mean square error, because it is the mean of the standard deviation.

Example:

` Sequence: [2, 3, 5, 6, 7, 9] Mean = 5.33 Total Terms, n = 6 Squared Deviation = (2 - 5.33)  2  + (3 - 5.33)  2  + (5 - 5.33)  2  (6 - 5.33)  2  + (7 - 5.33)  2  + (9 - 5.33)  2  Variance = Squared Deviation / n `

Code —

 ` # Dispersion ` ` `  ` import ` ` numpy as np `   ` Sequence ` ` = ` ` [` ` 2 ` `, ` ` 3 ` `, ` ` 5 ` `, ` ` 6 ` `, ` ` 7 ` `, ` ` 9 ` `] `   ` var ` ` = ` ` np.var (Sequence) `   ` print ` ` (` ` "Variance:" ` `, var) `

Output:

` Variance: 5.5555555555555545 `
• Standard Deviation: is the square root of the variance. Also referred to as Euclidean norm

Example:

` Sequence: [2, 3, 5, 6, 7, 9] Mean = 5.33 Total Terms, n = 6 Squared Deviation = (2 - 5.33)  2  + (3 - 5.33)  2  + (5 - 5.33)  2  (6 - 5.33)  2  + (7 - 5.33)  2  + (9 - 5.33)  2  Variance = Squared Deviation / n Standard Deviation = (Variance)  1/2  `

Code —

 ` # Standard deviation `   ` import ` ` numpy as np `   ` Sequence ` ` = ` ` [` ` 2 ` `, ` ` 3 ` `, ` ` 5 ` `, ` ` 6 ` `, ` ` 7 ` `, ` ` 9 ` `] `   ` std ` ` = ` ` np.std (Sequence) `   ` print ` ` (` ` "Standard Deviation:" ` ` , std) `

Output:

` Standard Deviation: 2.357022603955158 `
• Average absolute deviation: you can estimate the typical estimate of these deviations. If we average the values, negative deviations will displace positive ones. Also, the sum of deviations from the mean is always zero. Thus, this is a simple approach for averaging the deviation itself.

Example:

` Sequence: [2, 4, 6, 8] Mean = 5 Deviation around  mean  = [-3, -1, 1, 3] Mean Absolute Deviation = (3 + 1 + 1 + 3) / 4 `

` `

` # Average Absolute Deviation    import numpy as np   def mad (data): return np. mean (np.absolute ( data - np. mean (data)))    Sequence = [ 2 , 4 , 6 , 8 ]     print ( "Mean Absolute Deviation: " , mad (Sequence)) `

` `

Output:

` Mean Absolute Deviation: 2.0 `

## Shop Learn programming in R: courses

\$FREE Best Python online courses for 2022

\$FREE Best laptop for Fortnite

\$399+ Best laptop for Excel

\$ Best laptop for Solidworks

\$399+ Best laptop for Roblox

\$399+ Best computer for crypto mining

\$499+ Best laptop for Sims 4

\$

Latest questions

PythonStackOverflow

Common xlabel/ylabel for matplotlib subplots

PythonStackOverflow

Check if one list is a subset of another in Python

PythonStackOverflow

How to specify multiple return types using type-hints

PythonStackOverflow

Printing words vertically in Python

PythonStackOverflow

Python Extract words from a given string

PythonStackOverflow

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

PythonStackOverflow

Python os.path.join () method

PythonStackOverflow

Flake8: Ignore specific warning for entire file

## Wiki

Python | How to copy data from one Excel sheet to another

Common xlabel/ylabel for matplotlib subplots

Check if one list is a subset of another in Python

How to specify multiple return types using type-hints

Printing words vertically in Python

Python Extract words from a given string

Cyclic redundancy check in Python

Finding mean, median, mode in Python without libraries