emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer M Krug <r.m.krug@gmail.com>
To: Thorsten <gruenderteam.berlin@googlemail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: org-table formulas with missing values
Date: Sat, 5 Mar 2011 12:01:16 +0100	[thread overview]
Message-ID: <AANLkTi=NcQ-1oPxjQ14yWju2-P+=iHBTcmC7Ai3SF8AM@mail.gmail.com> (raw)
In-Reply-To: <86vczxbzuy.fsf@googlemail.com>

On Sat, Mar 5, 2011 at 11:55 AM, Thorsten
<gruenderteam.berlin@googlemail.com> wrote:
> Bastien <bzg@altern.org> writes:
>
>> Hi Thorsten,
>>
>> Thorsten <gruenderteam.berlin@googlemail.com> writes:
>>
>>> Ok, trial and error suggests that missing values in numeric columns can
>>> be represented as 0 in formulas, in string columns as "". Is there
>>> something like NaN in calc/org-table?
>>
>> I don't know what is NaN.  Can you give an example of what you're trying
>> to achieve?
>
> NaN stands for NotaNumber and is usually used in statistic programs to
> denote missing numerical values

NaN ia, as you state, NotANumber, but it is NOT a missing value, for
which the abbreviation is NA (Not Vavailable). An example for NaN
would be 1/0 - the value is there, but it is not a number. And,
consequently, NaN and NA can be treated separately. In general, if you
enter values, you use NA, as you usually do not enter values which are
not a number...

> (that deserve special treatment, since
> including them in the calculations as 0 values would not be wise due to
> introduced bias or confusion with true measurements of a value=0).

True.

>
> Fot example:
>
> | day | tel- calls |          change (%) |
> |-----+------------+---------------------|
> |   1 |          7 |                   0 |
> |   2 |          2 |                 -71 |
> |   3 |          3 |                  50 |
> |   4 |            |                   0 |
> |   5 |          2 | round((2/0) 100, 0) |
> |   6 |          0 |                   0 |
> |   7 |          3 | round((3/0) 100, 0) |
>
> #+TBLFM: $3=if(@$-1=0,0,round((((@$-1-@-1$-1) / @-1$-1) * 100),
>  0)::@2$3=@2$2-@2$2
>
>
> Here one measurement (day 4) was missed, one day had 0 tel-calls (day
> 6).
> The change (%) is :
> ((calls day x) - (calls day x-1)) / (calls day x-1) * 100.
>
> The column-formula treats measurment and zero value the same, although
> it would be better to replace the missing value with the average (but
> how to adress it in the formula if not with 0 ?), and it treats the zero
> measurement like a missing value here. Even if there would be no zero
> value here, the missing value would cause a 'divide by zero' error.
>
> I could write 'nan' instead of leaving a blank, and use the string in
> the formula, but this causes errors.
>
> But calc does know the concept of nan: "The variables `inf', `uinf', and
> `nan' stand for infinite or indeterminate values.  It's best not to use
> them as regular variables, since Calc uses special algebraic rules when
> it manipulates them.  Calc displays a warning message if you store a
> value into any of these special variables."
>
> I'm not sure how to use that nan variable in tables and formulas - it
> seems not to be recognized.
>
> Thorsten
>
>
>



-- 
NEW GERMAN FAX NUMBER!!!

Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Cell:           +27 - (0)83 9479 042
Fax:            +27 - (0)86 516 2782
Fax:            +49 - (0)321 2125 2244
email:          Rainer@krugs.de

Skype:          RMkrug
Google:         R.M.Krug@gmail.com

  reply	other threads:[~2011-03-05 11:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-26 18:32 org-table formulas with missing values Thorsten
2011-02-27  0:01 ` Thorsten
2011-02-27 11:45   ` Bastien
2011-03-05 10:55     ` Thorsten
2011-03-05 11:01       ` Rainer M Krug [this message]
2011-03-06 22:44         ` Thorsten
2011-03-06 23:03           ` suvayu ali
2011-03-08 19:18             ` Thorsten

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTi=NcQ-1oPxjQ14yWju2-P+=iHBTcmC7Ai3SF8AM@mail.gmail.com' \
    --to=r.m.krug@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=gruenderteam.berlin@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).