Calculate Mean absolute Deviation | Unix Linux Forums | Shell Programming and Scripting

  Go Back    

Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Calculate Mean absolute Deviation

Shell Programming and Scripting

Closed Thread    
Thread Tools Search this Thread Display Modes
Old 01-25-2013
Diya123 Diya123 is offline
Registered User
Join Date: May 2011
Last Activity: 21 May 2014, 3:07 PM EDT
Posts: 139
Thanks: 7
Thanked 1 Time in 1 Post
Calculate Mean absolute Deviation


I am trying to use an statistical formula. I tried in excel, but I get different values when I use calculator.

The formula is
(1/n) ∑|x mean|
n=no. of observations
x=each individual expression value
mean is median of all observations

I have a file with 1000 rows.. So it needs to calculate the MAD for each row..


12.8165	12.86361	12.65535	12.75554	12.88999	13.12837	13.05147	13.18671	13.2494	13.2906	13.16096	13.04806	12.49505	13.27213	13.13943
12.93171	13.41074	12.16979	13.01464	13.10369	13.78584	13.36401	13.3254	13.20534	13.16263	13.32761	13.27332	13.39617	13.44481	13.3401

I want to give it a try in awk

Sponsored Links
Old 01-25-2013
Yoda's Avatar
Yoda Yoda is offline Forum Advisor  
Jedi Master
Join Date: Jan 2012
Last Activity: 24 January 2015, 11:03 PM EST
Location: Galactic Empire
Posts: 3,401
Thanks: 240
Thanked 1,215 Times in 1,141 Posts
What formula did you use in Excel?

Did you try using AVEDEV
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
AWK script for standard deviation / root mean square deviation chrisjorg Shell Programming and Scripting 12 01-18-2012 12:30 PM
Standard deviation in awk gd9629 Shell Programming and Scripting 11 08-24-2011 01:40 PM
Calculate age of a file | calculate time difference worm Shell Programming and Scripting 10 02-15-2011 06:59 AM
Calculating the Standard Deviation for a column kylle345 UNIX for Dummies Questions & Answers 1 05-18-2009 05:58 PM
Mean and Standard deviation Shell Programming and Scripting 4 04-27-2009 04:04 PM

All times are GMT -4. The time now is 08:13 AM.