From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Andrews Subject: Re: orgmode and anova Date: Fri, 22 Apr 2016 01:56:33 +0000 Message-ID: References: <87shye6ao3.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c11be707d75570531092391 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atQKr-000843-RN for emacs-orgmode@gnu.org; Thu, 21 Apr 2016 21:56:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1atQKq-00075K-L6 for emacs-orgmode@gnu.org; Thu, 21 Apr 2016 21:56:45 -0400 Received: from mail-vk0-x230.google.com ([2607:f8b0:400c:c05::230]:32954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atQKq-00075B-Fi for emacs-orgmode@gnu.org; Thu, 21 Apr 2016 21:56:44 -0400 Received: by mail-vk0-x230.google.com with SMTP id n62so119755241vkb.0 for ; Thu, 21 Apr 2016 18:56:44 -0700 (PDT) In-Reply-To: <87shye6ao3.fsf@mat.ucm.es> 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" To: emacs-orgmode@gnu.org --94eb2c11be707d75570531092391 Content-Type: text/plain; charset=UTF-8 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 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 > > > --94eb2c11be707d75570531092391 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

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

model <- lm(delivered_seeing ~ zeenith_seeing, data =3D d= elsee)
anova(model)

You would need non-zero residuals for that to be useful of c= ourse.

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 =3D delsee2)=

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

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


On Thu, Apr 21, 2016, 15:10= Uwe Brauer <oub@mat.ucm.es> wr= ote:
Hello

Using Kubuntu I just installed R and the following code works nicely

#+tblname: delsee
| airmass | zenith_seeing | delivered_seeing |
|---------+---------------+------------------|
|=C2=A0 =C2=A0 =C2=A01.3 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0.95 |=C2=A0 = =C2=A0 =C2=A0 =C2=A0 1.1119612 |
|=C2=A0 =C2=A0 =C2=A01.3 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01.0 |=C2= =A0 =C2=A0 =C2=A0 =C2=A0 1.1704854 |
|=C2=A0 =C2=A0 =C2=A01.3 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01.1 |=C2= =A0 =C2=A0 =C2=A0 =C2=A0 1.2875340 |
|=C2=A0 =C2=A0 =C2=A01.3 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01.2 |=C2= =A0 =C2=A0 =C2=A0 =C2=A0 1.4045825 |
#+TBLFM: $3=3D$2*($1**0.6)


#+begin_src R :results output :var delsee=3Ddelsee
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


--94eb2c11be707d75570531092391--