Tukey tests in two-way ANOVA

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Tukey tests in two-way ANOVA

Lucy McMahon
R-help:

I'm looking into the abundance of an algal species over site and years using a two-way ANOVA:

> summary (aov (fserratus ~ site+year))
            Df     Sum Sq   Mean Sq   F value      Pr(>F)
site       1      1487       1486.6      6.094       0.0155 *
year      1      1173      1172.8      4.808       0.0309 *

But I'm receiving the following warning messages when I run the Tukey test.
> TukeyHSD(aov(fserratus ~ site+year))

$site
                    diff              lwr                      upr                 p adj
1-0         -8.039565     -14.51045     -1.568685    0.0154723

Warning messages:
1: In replications(paste("~", xx), data = mf) : non-factors ignored: year
2: In TukeyHSD.aov(aov(fserratus ~ site + year)) :
  'which' specified some non-factors which will be dropped


Any advice would be appreciated, thanks.




        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Tukey tests in two-way ANOVA

Peter Dalgaard-2
I think you forgot to turn site and year into factors. (The 1 Df is the giveaway).

-pd

> On 15 May 2017, at 19:40 , Lucy McMahon <[hidden email]> wrote:
>
> R-help:
>
> I'm looking into the abundance of an algal species over site and years using a two-way ANOVA:
>
>> summary (aov (fserratus ~ site+year))
>            Df     Sum Sq   Mean Sq   F value      Pr(>F)
> site       1      1487       1486.6      6.094       0.0155 *
> year      1      1173      1172.8      4.808       0.0309 *
>
> But I'm receiving the following warning messages when I run the Tukey test.
>> TukeyHSD(aov(fserratus ~ site+year))
>
> $site
>                    diff              lwr                      upr                 p adj
> 1-0         -8.039565     -14.51045     -1.568685    0.0154723
>
> Warning messages:
> 1: In replications(paste("~", xx), data = mf) : non-factors ignored: year
> 2: In TukeyHSD.aov(aov(fserratus ~ site + year)) :
>  'which' specified some non-factors which will be dropped
>
>
> Any advice would be appreciated, thanks.
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: [hidden email]  Priv: [hidden email]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Tukey tests in two-way ANOVA

Richard M. Heiberger
In reply to this post by Lucy McMahon
you have only one df for site and one df for year.  most likely you
skipped the step of
telling R those are factors.

On Mon, May 15, 2017 at 1:40 PM, Lucy McMahon
<[hidden email]> wrote:

> R-help:
>
> I'm looking into the abundance of an algal species over site and years using a two-way ANOVA:
>
>> summary (aov (fserratus ~ site+year))
>             Df     Sum Sq   Mean Sq   F value      Pr(>F)
> site       1      1487       1486.6      6.094       0.0155 *
> year      1      1173      1172.8      4.808       0.0309 *
>
> But I'm receiving the following warning messages when I run the Tukey test.
>> TukeyHSD(aov(fserratus ~ site+year))
>
> $site
>                     diff              lwr                      upr                 p adj
> 1-0         -8.039565     -14.51045     -1.568685    0.0154723
>
> Warning messages:
> 1: In replications(paste("~", xx), data = mf) : non-factors ignored: year
> 2: In TukeyHSD.aov(aov(fserratus ~ site + year)) :
>   'which' specified some non-factors which will be dropped
>
>
> Any advice would be appreciated, thanks.
>
>
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.