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
    #1  
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

Hi,

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..

input:

Code:
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

Thanks,
Sponsored Links
    #2  
Old 01-25-2013
Yoda's Avatar
Yoda Yoda is offline Forum Advisor  
Jedi Master
 
Join Date: Jan 2012
Last Activity: 30 October 2014, 6:50 PM EDT
Location: Galactic Empire
Posts: 3,387
Thanks: 235
Thanked 1,209 Times in 1,135 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 11:30 AM
Standard deviation in awk gd9629 Shell Programming and Scripting 11 08-24-2011 12:40 PM
Calculate age of a file | calculate time difference worm Shell Programming and Scripting 10 02-15-2011 05:59 AM
Calculating the Standard Deviation for a column kylle345 UNIX for Dummies Questions & Answers 1 05-18-2009 04:58 PM
Mean and Standard deviation lakshmikanth.pg Shell Programming and Scripting 4 04-27-2009 03:04 PM



All times are GMT -4. The time now is 02:04 AM.