## Calculate the Median, first quartile and third quartile using AWK

Calculate the Median, first quartile and third quartile using AWK
# 1
11-10-2008
Calculate the Median, first quartile and third quartile using AWK

Hi all,

I have a data range as follow:

28
33
42
12
9
68
81
55
6
47

Since I want to create Box & Whisker Plot, I need to calculate the median, first quartile and third quartile of above data using AWK.( so far I can only writing a code for determine smallest value & largest value using AWK)

Anyone can help me...Please..

Thanks
 nica View Public Profile for nica Find all posts by nica
# 2
12-09-2008
unix calculator

Hi,

I would like to know how can I calculate mean, median and standard deviation of some numbers in a file.

Example file:
a 102 abc

I would like to calculate the mean, median and standard deviation of the numbers in the 2nd column of the example file.

 fadista View Public Profile for fadista Find all posts by fadista
# 3
12-09-2008
Maybe you should use awk instead of calculator to get the results. It would be much easier to grab the 2nd field an do the math on those.
 BubbaJoe View Public Profile for BubbaJoe Find all posts by BubbaJoe
# 4
12-09-2008
this will find the mean of numbers

Last edited by otheus; 01-30-2009 at 05:25 AM.. Reason: Corrected equation for mean
 vidyadhar85 View Public Profile for vidyadhar85 Find all posts by vidyadhar85
# 5
01-30-2009
For the median, you can the answer in this post to your problem. In this case, you will want to change "\$NF" to "\$2".
 otheus View Public Profile for otheus Find all posts by otheus

Test Your Knowledge in Computers #358
Difficulty: Medium
ibmawk is a fork of mawk, allowing applications to embed multiple parallel instances of awk interpreters.
True or False?

## How to print median values of matrix -awk?

I use the following script to print the sum and how could I extend this to print medians instead? thanks name s1 s2 s3 s4 g1 2 8 6 5 g1 5 7 9 9 g1 6 7 8 9 g2 8 8 8 8 g2 7 7 7 7 g2 10 10 10 10 g3 3 12 1 24 g3 5 5 24 48 g3 12 3 12 12 g3 2 3 3 3 output name s1 s2 s3 s4 g1 5 7 8 9...

## Awk based script to find the median of all individual columns in a data file

Hi All, I have some data like below. Step1,Param1,Param2,Param3 1,2,3,4 2,3,4,5 2,4,5,6 3,0,1,2 3,0,0,0 3,2,1,3 ........ so on Where I need to find the median(arithmetic) of each column from Param1...to..Param3 for each set of Step1 values. (Sort each specific column, if the...

## Compute the median of a set of numbers with AWK?

Is there a way in awk to compute the median of a set of numbers in a file in the following format. 34 67 78 100 23 45 67

## Help with calculate median, first quartile, second quartile and third quartile

Input file: 21.08 21.06 20.98 20.65 18.52 16.34 13.58 12.2 10.66 10.22 9.8 8.6 7.4 3.9 3.5 Desired output file:

## awk to median

hi! i have a file like the attachement. you can see on the last column, there is a marker from 1 to 64 for each time. I'd like to have the median for each marker: i want to get a median every 128 values the result is : for an hour and marker x, i have the median value thank you for...

## How to calculate with awk

Hi, I have below awk statement and I need to convert the second field ( substr(\$0,8,6))from minutes to hours with 2 decimail place. How can I achieve this? /usr/bin/awk '{print substr(\$0,23,4),substr(\$0,8,6)}' /tmp/MANAGER_LIST.\$\$ >> /tmp/NEWMANAGER_LIST.\$\$ Thanks for any help!