emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Andrews <kyle.c.andrews@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: orgmode and anova
Date: Fri, 22 Apr 2016 01:56:33 +0000	[thread overview]
Message-ID: <CAG3md+tXKSfKYoCVSbVw=ENCTSDAkyt5a0bUfuzrbV_LG4RJfg@mail.gmail.com> (raw)
In-Reply-To: <87shye6ao3.fsf@mat.ucm.es>

[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]

If you wanted to fit a linear regression model with R, you could do so with
the lm function. Calling anova on the output of the regression would give
you a regression anova table.

model <- lm(delivered_seeing ~ zeenith_seeing, data = delsee)
anova(model)

You would need non-zero residuals for that to be useful of course.

Otherwise, you need to stack your *_seeing columns into one column with
another column saying which kind of seeing it was and then:

model.aov <- aov(seeing ~ factor(kind), data = delsee2)

You could do the stacking in a number of ways. My favorite is to use the
gather function in the tidyr package.

aov is just a wrapper around lm, so just take the same approach as before
to get the ANOVA table. Hope that helps.

On Thu, Apr 21, 2016, 15:10 Uwe Brauer <oub@mat.ucm.es> wrote:

> Hello
>
> Using Kubuntu I just installed R and the following code works nicely
>
> #+tblname: delsee
> | airmass | zenith_seeing | delivered_seeing |
> |---------+---------------+------------------|
> |     1.3 |          0.95 |        1.1119612 |
> |     1.3 |           1.0 |        1.1704854 |
> |     1.3 |           1.1 |        1.2875340 |
> |     1.3 |           1.2 |        1.4045825 |
> #+TBLFM: $3=$2*($1**0.6)
>
>
> #+begin_src R :results output :var delsee=delsee
> summary(delsee)
> #+end_src
>
>
> Does somebody know whether I could do an ANOVA, comparing these columns
> (which does not make much sense, but this is not the point.
>
> Any help is strongly appreciated.
>
> thanks
>
> Uwe Brauer
>
>
>

[-- Attachment #2: Type: text/html, Size: 2027 bytes --]

  reply	other threads:[~2016-04-22  1:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-21 19:09 orgmode and anova Uwe Brauer
2016-04-22  1:56 ` Kyle Andrews [this message]
2016-04-22  8:07   ` Uwe Brauer

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='CAG3md+tXKSfKYoCVSbVw=ENCTSDAkyt5a0bUfuzrbV_LG4RJfg@mail.gmail.com' \
    --to=kyle.c.andrews@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).