From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Statistics in Org-Tables Date: Wed, 20 Feb 2013 13:27:16 -0500 Message-ID: <2964.1361384836@alphaville> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8EO6-000825-13 for emacs-orgmode@gnu.org; Wed, 20 Feb 2013 13:27:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8EO4-00036P-IT for emacs-orgmode@gnu.org; Wed, 20 Feb 2013 13:27:25 -0500 Received: from g4t0016.houston.hp.com ([15.201.24.19]:19782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8EO4-00035P-D7 for emacs-orgmode@gnu.org; Wed, 20 Feb 2013 13:27:24 -0500 In-Reply-To: Message from Rodolfo Aramayo of "Wed, 20 Feb 2013 10:47:45 CST." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rodolfo Aramayo Cc: emacs-orgmode@gnu.org Rodolfo Aramayo wrote: > Simple question: What is the best way to configure/find out how to > calculate Median, Standard Deviation in an org-table? There are calc functions to compute these things, but the layout of your table will of course influence the formulas. Here's a simple example that calculates the statistics for the second column - it uses the @I..@II range reference notation to get the numbers between the first and second separators and the @> (@>>, @>>>, etc.) notation to refer to the last (last minus one, last minus two, etc.) row: --8<---------------cut here---------------start------------->8--- * mean, median, stdev | i | x | |--------+-----------| | 1 | 3 | | 2 | 1 | | 3 | 1 | | 4 | 2 | | 5 | 1 | | 6 | 3 | | 7 | 4 | | 8 | 1 | | 9 | 1 | |--------+-----------| | mean | 1.8888889 | | median | 1 | | sdev | 1.1666667 | | sum | 17 | #+TBLFM: @>$2=vsum(@I..@II) :: @>>>>$2=vmean(@I..@II) :: @>>>$2=vmedian(@I..@II) :: @>>$2=vsdev(@I..@II) --8<---------------cut here---------------end--------------->8--- More details about such references are in the Org manual: (info "(org) References") More details about the calc functions are in the Calc manual: (info "(calc) Single-variable statistics") Nick