I want help gathering

So i am trying to group together days in a data set so I can under take a anova however its not working, it keeps coming up with these errors
gather(key = "day", value = "Fm", day, day_1, day_2, day_3, day_4, day_5, day_6, day_7)
Error in gather(key = "day", value = "Fm", day, day_1, day_2, day_3, day_4, :
object 'day' not found
however I have changed the name four times - they are the same as my table I don't know what to do

Have you specified the data frame in gather()? It doesn't seem so from your code. Here is a working example on the iris data set.

library(dplyr, warn.conflicts = FALSE)
library(tidyr)

iris <- as_tibble(iris) # for nicer printing

gather(iris, 
       key = "flower_att", 
       value = "measurement", 
       Sepal.Length, Sepal.Width, Petal.Length, Petal.Width)
#> # A tibble: 600 x 3
#>    Species flower_att   measurement
#>    <fct>   <chr>              <dbl>
#>  1 setosa  Sepal.Length         5.1
#>  2 setosa  Sepal.Length         4.9
#>  3 setosa  Sepal.Length         4.7
#>  4 setosa  Sepal.Length         4.6
#>  5 setosa  Sepal.Length         5  
#>  6 setosa  Sepal.Length         5.4
#>  7 setosa  Sepal.Length         4.6
#>  8 setosa  Sepal.Length         5  
#>  9 setosa  Sepal.Length         4.4
#> 10 setosa  Sepal.Length         4.9
#> # ... with 590 more rows

Created on 2020-07-23 by the reprex package (v0.3.0)

Ahh yes, thank you! that has solved it

Also sorry for the add on ive run my anova and its significant and now ive ran the Tukey test but im unsure what the p.adj.significant column codes are??

I didn't follow your question. Are you asking what p adj is or what the output of Signif. codes means?

what the output of the significant codes mean in the end column, do the asterixs indicate a higher difference?

OK. I presume you're asking about the last row in the summary output. They are just visual indicators of the p-values. In the example below, the p-value for tension is 0.00138. This falls within the interval 0.001 - 0.01 which is indicated by **.

summary(aov(breaks ~ wool + tension, data = warpbreaks))
#>             Df Sum Sq Mean Sq F value  Pr(>F)   
#> wool         1    451   450.7   3.339 0.07361 . 
#> tension      2   2034  1017.1   7.537 0.00138 **
#> Residuals   50   6748   135.0                   
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Created on 2020-07-24 by the reprex package (v0.3.0)

You could also think of the upper bound of each interval as the level of significance. Using the example above, ** indicates that the variable tension is significant at a significance level of 0.01.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.