strengejacke / sjstats

Effect size measures and significance tests
https://strengejacke.github.io/sjstats
189 stars 21 forks source link

Eta-square of type 3 vs. type 2 Anova in car using "anova_stats": Help wanted #96

Closed eimichae closed 4 years ago

eimichae commented 4 years ago

Hi, I recently tried to use the function anova_stats of the sjstats package to calculate eta-squared statistic of a type 3 anova (car package) . I then compared the result with the eta-square values of the type 2 anova (car package) of exactly the same model.

Given that type 2 and 3 anovas are pre-se different I expected to get different eta-squared statistics. However, the differences were extremely different! When subjecting my type 3 anova to the anova_stats function, an intercept term was introduced that accounted for about 88% of the observed variance (eta-square of the intercept was 0.878) whereas all the other variables in the model had eta-squared values of <0.1. In contrast when subjecting the type 2 anova the anova_stats function no intercept term was introduced and my model variables had much higher eta-squared values (up to 0.5) Is this possible? The differences in terms of etasq. values between the two anovas seem to be rather extreme? Why is there an intercept term in the type3 anova but not in the type 2 anova? Thanks a lot for your help!

Below is my code and my raw data (dput)

CODE:

library(sjstats)
library(car)
#read-in data
dta_complete=read.csv("SLA_stat.csv",sep=";",header=T)
#REMOVE ALL "NA" VALUES-->Keep only complete cases
dta<-dta_complete[complete.cases(dta_complete), ]
#MODEL
mod_SLA_bc<-lm((SLA)^-1.787~Site*Geno_name,data=dta)
#TYPE 3 ANOVA USING CAR-->contrasts need to be properly specified
`T3Anova<-Anova(lm((SLA)^-1.787~Site*Geno_name,data=dta,contrasts=list(Site=contr.sum, Geno_name=contr.sum)),type=3)
#TYPE 2 ANOVA USING CAR 
T2Anova<-Anova(lm((SLA)^-1.787~Site*Geno_name,data=dta),type=2)
#ANOVAS SUBJECTED TO SJSTATS-->VERY DIFFERENT ETASQ!
anova_stats(T3Anova,digits=4)
anova_stats(T2Anova,digits=4)

DATA:

> dput(dta_complete)
structure(list(Site = structure(c(3L, 3L, 3L, 3L, 3L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 
3L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 
3L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 
3L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 
1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 
3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 
3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 3L, 
3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 
2L, 2L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 
2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 
2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 2L, 
2L, 2L, 2L, 2L, 2L), .Label = c("AF", "CRC", "YU"), class = "factor"), 
    ID_field = c(3L, 44L, 46L, 48L, 50L, 496L, 497L, 144L, 191L, 
    193L, 211L, 213L, 272L, 274L, 284L, 286L, 320L, 600L, 601L, 
    6L, 8L, 51L, 53L, 55L, 500L, 195L, 197L, 199L, 215L, 217L, 
    277L, 279L, 281L, 283L, 322L, 35L, 87L, 99L, 101L, 103L, 
    122L, 124L, 183L, 185L, 240L, 539L, 258L, 310L, 312L, 340L, 
    342L, 11L, 13L, 36L, 38L, 40L, 126L, 128L, 130L, 187L, 189L, 
    261L, 263L, 314L, 316L, 318L, 16L, 18L, 57L, 59L, 104L, 146L, 
    148L, 150L, 229L, 231L, 288L, 290L, 581L, 349L, 351L, 353L, 
    395L, 74L, 76L, 78L, 118L, 120L, 470L, 471L, 159L, 161L, 
    163L, 176L, 178L, 266L, 268L, 270L, 337L, 339L, 371L, 42L, 
    79L, 81L, 83L, 85L, 491L, 494L, 180L, 221L, 223L, 225L, 227L, 
    300L, 302L, 344L, 346L, 348L, 1L, 361L, 20L, 22L, 62L, 64L, 
    473L, 475L, 134L, 505L, 165L, 167L, 232L, 234L, 242L, 244L, 
    303L, 323L, 325L, 24L, 26L, 65L, 67L, 116L, 476L, 477L, 136L, 
    138L, 170L, 236L, 238L, 247L, 249L, 306L, 355L, 357L, 29L, 
    31L, 33L, 70L, 72L, 132L, 480L, 140L, 142L, 172L, 174L, 308L, 
    326L, 328L, 358L, 360L, 89L, 91L, 105L, 107L, 109L, 481L, 
    152L, 154L, 200L, 202L, 204L, 251L, 253L, 292L, 294L, 296L, 
    585L, 586L, 94L, 96L, 110L, 112L, 114L, 157L, 206L, 208L, 
    218L, 220L, 256L, 549L, 298L, 331L, 333L, 335L), Block = c(1L, 
    2L, 2L, 2L, 2L, 1L, 1L, 2L, 3L, 3L, 4L, 4L, 1L, 1L, 2L, 2L, 
    3L, 4L, 4L, 1L, 1L, 2L, 2L, 2L, 1L, 3L, 3L, 3L, 4L, 4L, 1L, 
    1L, 1L, 1L, 3L, 2L, 3L, 4L, 4L, 4L, 1L, 1L, 3L, 3L, 4L, 4L, 
    1L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 3L, 3L, 
    1L, 1L, 2L, 2L, 2L, 1L, 1L, 3L, 3L, 4L, 2L, 2L, 2L, 4L, 4L, 
    2L, 2L, 3L, 4L, 4L, 4L, 1L, 3L, 3L, 3L, 4L, 4L, 1L, 1L, 2L, 
    2L, 2L, 3L, 3L, 1L, 1L, 1L, 3L, 3L, 1L, 2L, 3L, 3L, 3L, 3L, 
    1L, 1L, 3L, 4L, 4L, 4L, 4L, 2L, 2L, 3L, 3L, 3L, 1L, 1L, 2L, 
    2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, 1L, 1L, 2L, 3L, 
    3L, 2L, 2L, 3L, 3L, 4L, 1L, 1L, 2L, 2L, 3L, 4L, 4L, 1L, 1L, 
    2L, 4L, 4L, 2L, 2L, 2L, 3L, 3L, 1L, 1L, 2L, 2L, 3L, 3L, 2L, 
    3L, 3L, 4L, 4L, 3L, 3L, 4L, 4L, 4L, 1L, 2L, 2L, 3L, 3L, 3L, 
    1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 2L, 3L, 3L, 
    4L, 4L, 1L, 1L, 2L, 3L, 3L, 3L), Plot = c(5L, 32L, 32L, 32L, 
    32L, 15L, 15L, 21L, 42L, 42L, 51L, 51L, 16L, 16L, 22L, 22L, 
    35L, 52L, 52L, 5L, 5L, 32L, 32L, 32L, 15L, 42L, 42L, 42L, 
    51L, 51L, 16L, 16L, 16L, 16L, 35L, 20L, 41L, 49L, 49L, 49L, 
    4L, 4L, 41L, 41L, 60L, 60L, 4L, 31L, 31L, 46L, 46L, 8L, 8L, 
    20L, 20L, 20L, 4L, 4L, 4L, 41L, 41L, 4L, 4L, 31L, 31L, 31L, 
    10L, 10L, 34L, 34L, 51L, 26L, 26L, 26L, 58L, 58L, 23L, 23L, 
    33L, 51L, 51L, 51L, 16L, 39L, 39L, 39L, 64L, 64L, 9L, 9L, 
    32L, 32L, 32L, 39L, 39L, 5L, 5L, 5L, 42L, 42L, 6L, 25L, 40L, 
    40L, 40L, 40L, 14L, 14L, 40L, 55L, 55L, 55L, 55L, 29L, 29L, 
    48L, 48L, 48L, 2L, 2L, 17L, 17L, 35L, 35L, 11L, 11L, 18L, 
    18L, 35L, 35L, 59L, 59L, 1L, 1L, 30L, 38L, 38L, 17L, 17L, 
    35L, 35L, 57L, 11L, 11L, 18L, 18L, 35L, 59L, 59L, 1L, 1L, 
    30L, 57L, 57L, 17L, 17L, 17L, 35L, 35L, 11L, 11L, 18L, 18L, 
    35L, 35L, 30L, 38L, 38L, 57L, 57L, 43L, 43L, 53L, 53L, 53L, 
    12L, 30L, 30L, 43L, 43L, 43L, 3L, 3L, 25L, 25L, 25L, 41L, 
    41L, 43L, 43L, 53L, 53L, 53L, 30L, 43L, 43L, 53L, 53L, 3L, 
    3L, 25L, 41L, 41L, 41L), Popul = structure(c(5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 
    6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 
    6L, 6L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 
    7L, 7L, 7L, 7L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
    3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 
    4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 4L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L), .Label = c("CAFAUG", "CCRCOL", "JLAJAK", 
    "KKHOPI", "KWFWIL", "LBWBIL", "SCTMEX"), class = "factor"), 
    Elv.m = c(1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 
    1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 
    1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 
    1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 1126L, 
    1126L, 143L, 143L, 143L, 143L, 143L, 143L, 143L, 143L, 143L, 
    143L, 143L, 143L, 143L, 143L, 143L, 143L, 143L, 143L, 143L, 
    143L, 143L, 143L, 143L, 143L, 143L, 143L, 143L, 143L, 143L, 
    143L, 143L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 
    26L, 26L, 26L, 26L, 26L, 26L, 26L, 70L, 70L, 70L, 70L, 70L, 
    70L, 70L, 70L, 70L, 70L, 70L, 70L, 70L, 70L, 70L, 70L, 70L, 
    70L, 1507L, 1507L, 1507L, 1507L, 1507L, 1507L, 1507L, 1507L, 
    1507L, 1507L, 1507L, 1507L, 1507L, 1507L, 1507L, 1507L, 1507L, 
    1507L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 
    1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 
    1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 
    1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 
    1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 
    1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 1920L, 988L, 
    988L, 988L, 988L, 988L, 988L, 988L, 988L, 988L, 988L, 988L, 
    988L, 988L, 988L, 988L, 988L, 989L, 990L, 988L, 988L, 988L, 
    988L, 988L, 988L, 988L, 988L, 988L, 988L, 988L, 988L, 988L, 
    988L, 988L, 988L), Elv.grp = structure(c(3L, 3L, 3L, 3L, 
    3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
    3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
    3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
    3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
    3L, 3L, 3L, 3L, 3L), .Label = c("High", "Low", "Mid"), class = "factor"), 
    Geno = c(121L, 121L, 121L, 121L, 121L, 121L, 121L, 121L, 
    121L, 121L, 121L, 121L, 121L, 121L, 121L, 121L, 121L, 121L, 
    121L, 130L, 130L, 130L, 130L, 130L, 130L, 130L, 130L, 130L, 
    130L, 130L, 130L, 130L, 130L, 130L, 130L, 137L, 137L, 137L, 
    137L, 137L, 137L, 137L, 137L, 137L, 137L, 137L, 137L, 137L, 
    137L, 137L, 137L, 142L, 142L, 142L, 142L, 142L, 142L, 142L, 
    142L, 142L, 142L, 142L, 142L, 142L, 142L, 142L, 143L, 143L, 
    143L, 143L, 143L, 143L, 143L, 143L, 143L, 143L, 143L, 143L, 
    143L, 143L, 143L, 143L, 149L, 149L, 149L, 149L, 149L, 149L, 
    149L, 149L, 149L, 149L, 149L, 149L, 149L, 149L, 149L, 149L, 
    149L, 149L, 158L, 158L, 158L, 158L, 158L, 158L, 158L, 158L, 
    158L, 158L, 158L, 158L, 158L, 158L, 158L, 158L, 158L, 158L, 
    164L, 164L, 164L, 164L, 164L, 164L, 164L, 164L, 164L, 164L, 
    164L, 164L, 164L, 164L, 164L, 164L, 164L, 164L, 164L, 172L, 
    172L, 172L, 172L, 172L, 172L, 172L, 172L, 172L, 172L, 172L, 
    172L, 172L, 172L, 172L, 172L, 172L, 180L, 180L, 180L, 180L, 
    180L, 180L, 180L, 180L, 180L, 180L, 180L, 180L, 180L, 180L, 
    180L, 180L, 184L, 184L, 184L, 184L, 184L, 184L, 184L, 184L, 
    184L, 184L, 184L, 184L, 184L, 184L, 184L, 184L, 184L, 184L, 
    193L, 193L, 193L, 193L, 193L, 193L, 193L, 193L, 193L, 193L, 
    193L, 193L, 193L, 193L, 193L, 193L), Geno_name = structure(c(5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 
    6L, 6L, 6L, 6L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 4L, 4L, 4L, 4L, 4L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
    3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 9L, 9L, 9L, 9L, 9L, 9L, 
    9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 11L, 11L, 
    11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
    11L, 11L, 11L, 11L, 11L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 
    12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 
    7L, 7L, 7L, 7L, 7L, 7L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 
    8L, 8L, 8L, 8L, 8L, 8L, 8L), .Label = c("A", "B", "C", "D", 
    "E", "F", "G", "H", "I", "J", "K", "L"), class = "factor"), 
    Geno_name2 = structure(c(9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 
    9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 
    6L, 6L, 6L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 
    8L, 8L, 8L, 8L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 
    7L, 7L, 7L, 7L, 7L, 7L, 7L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 
    3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 
    4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
    11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 12L, 12L, 12L, 12L, 
    12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L
    ), .Label = c("H1", "H2", "H3", "H4", "L1", "L2", "L3", "L4", 
    "M1", "M2", "M3", "M4"), class = "factor"), Trt. = structure(c(1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "C", class = "factor"), 
    Nr_leaves_collected..bag. = c(25L, 34L, 40L, 33L, 31L, NA, 
    NA, 50L, NA, NA, 23L, 30L, 16L, 18L, NA, NA, 28L, 33L, 38L, 
    22L, 31L, 33L, 31L, 29L, NA, 44L, NA, 38L, 30L, 32L, 20L, 
    21L, 9L, 13L, 33L, 43L, 25L, 35L, 32L, 39L, 79L, 67L, 21L, 
    32L, NA, 29L, 33L, NA, NA, NA, NA, 26L, 25L, 26L, 36L, 32L, 
    54L, 53L, 50L, 23L, 26L, 24L, 23L, 14L, 16L, NA, 35L, 37L, 
    42L, 42L, 39L, 55L, 45L, 78L, 33L, 39L, NA, 17L, 31L, 34L, 
    25L, 20L, 34L, 36L, 39L, 64L, NA, 48L, NA, NA, NA, 46L, NA, 
    30L, 38L, 24L, 26L, 35L, 34L, 32L, 12L, 38L, NA, 14L, NA, 
    52L, 41L, 37L, 42L, 40L, 36L, NA, NA, 24L, 30L, 36L, 35L, 
    35L, 17L, 15L, 46L, 58L, 35L, NA, 28L, 36L, 26L, 24L, NA, 
    118L, NA, NA, 29L, 29L, 22L, 35L, 34L, 43L, 28L, 25L, 32L, 
    36L, 50L, 41L, 32L, 26L, NA, NA, 34L, 5L, 21L, 9L, 8L, 10L, 
    36L, 35L, 36L, 17L, 33L, 27L, 24L, NA, 40L, NA, NA, 9L, 6L, 
    42L, 8L, 13L, 35L, 48L, 48L, 40L, 38L, NA, 39L, 43L, 37L, 
    NA, 27L, 57L, NA, 27L, NA, 20L, 27L, 14L, 32L, 37L, 41L, 
    36L, 26L, 75L, 34L, 25L, 24L, 34L, 41L, 33L, 32L, NA, 45L, 
    16L), Nr_leaves_measure = c(10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 9L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 5L, 
    10L, 9L, 8L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 9L, 6L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L), Dry_wt_10_leaves_mg = c(451, 
    591.4, 592, 477.1, 346.2, NA, NA, 540.7, NA, NA, 683.4, 359.8, 
    561.3, 704.8, NA, NA, 637.8, 750.6, 294.1, 463.2, 431.2, 
    375.2, 553.9, 344.8, NA, 480.6, NA, 481.9, 809.6, 636.4, 
    583.2, 422.5, 1282.8, 1540.4, 355.1, 620.1, 751.4, 333.9, 
    550.6, 480.1, 475.2, 203.1, 241, 492.9, NA, 541.5, 579.6, 
    NA, NA, NA, NA, 332.7, 306.9, 435.1, 418, 350.6, 349.7, 241.4, 
    371.4, 203.5, 341.2, 459.8, 150.9, 141.2, 454.6, NA, 519, 
    462.6, 383.1, 314.6, 306.6, 302.4, 343, 233.3, 451.4, 652.8, 
    NA, 1421.2, 449.7, 1187.9, 1408.8, 1445.8, 241.8, 259.8, 
    227, 294.1, NA, 588, NA, NA, NA, 344.6, NA, 396.3, 304.5, 
    400.3, 495.3, 983.9, 795.4, 735.9, 718.7, 1862.8, NA, 706, 
    NA, 419.8, 533.9, 2097.7, 748.1, 1016.9, 510.3, NA, NA, 508.7, 
    449.5, 473.8, 441.1, 521.5, 601.1, 359.1, 839.2, 1354.1, 
    1073.7, NA, 807.3, 909.3, 1267.2, 2101.5, NA, 551.4, NA, 
    NA, 1264.6, 707.9, 606.9, 678, 668.5, 796.3, 887.3, 693.1, 
    954.4, 837, 1375.2, 1121.2, 375.7, 1820.9, NA, NA, 1974.8, 
    265.1, 863, 965.4, 466.4, 1026.9, 781.2, 1284, 593, 842.5, 
    693.3, 1194.3, 930.6, NA, 1008.1, NA, NA, 937.8, 945.2, 457.7, 
    784.6, 1832.5, 784, 256.1, 404.4, 454, 425.8, NA, 547.4, 
    612.6, 284.9, NA, 247.8, 352.8, NA, 639.9, NA, 1075.9, 1268.9, 
    331.2, 345.2, 254.6, 187.4, 321.9, 170, 276.4, 597.5, 270, 
    222.6, 180.8, 437.7, 342.5, 117.3, NA, 265.2, 342.1), Wt_av = c(45.1, 
    59.14, 59.2, 47.71, 34.62, NA, NA, 54.07, NA, NA, 68.34, 
    35.98, 56.13, 70.48, NA, NA, 63.78, 75.06, 29.41, 46.32, 
    43.12, 37.52, 55.39, 34.48, NA, 48.06, NA, 48.19, 80.96, 
    63.64, 58.32, 42.25, 128.28, 154.04, 35.51, 62.01, 75.14, 
    33.39, 55.06, 48.01, 47.52, 20.31, 24.1, 49.29, NA, 54.15, 
    57.96, NA, NA, NA, NA, 33.27, 30.69, 43.51, 41.8, 35.06, 
    34.97, 24.14, 37.14, 20.35, 34.12, 45.98, 15.09, 14.12, 45.46, 
    NA, 51.9, 46.26, 38.31, 31.46, 30.66, 30.24, 34.3, 23.33, 
    45.14, 65.28, NA, 142.12, 44.97, 118.79, 140.88, 144.58, 
    24.18, 25.98, 22.7, 29.41, NA, 58.8, NA, NA, NA, 34.46, NA, 
    39.63, 30.45, 40.03, 49.53, 98.39, 79.54, 73.59, 71.87, 186.28, 
    NA, 70.6, NA, 41.98, 53.39, 209.77, 74.81, 101.69, 51.03, 
    NA, NA, 50.87, 44.95, 47.38, 44.11, 52.15, 60.11, 35.91, 
    83.92, 135.41, 107.37, NA, 80.73, 90.93, 126.72, 210.15, 
    NA, 55.14, NA, NA, 126.46, 70.79, 60.69, 67.8, 66.85, 79.63, 
    88.73, 69.31, 95.44, 83.7, 137.52, 112.12, 37.57, 182.09, 
    NA, NA, 197.48, 26.51, 86.3, 96.54, 46.64, 102.69, 78.12, 
    128.4, 59.3, 84.25, 69.33, 119.43, 93.06, NA, 100.81, NA, 
    NA, 93.78, 94.52, 45.77, 78.46, 183.25, 78.4, 25.61, 40.44, 
    45.4, 42.58, NA, 54.74, 61.26, 28.49, NA, 24.78, 35.28, NA, 
    63.99, NA, 107.59, 126.89, 33.12, 34.52, 25.46, 18.74, 32.19, 
    17, 27.64, 59.75, 27, 22.26, 18.08, 43.77, 34.25, 11.73, 
    NA, 26.52, 34.21), Area_10_leaves_cm2 = c(40.42, 55.91, 50.9, 
    42.33, 31.7, NA, NA, 52.48, NA, NA, 101.37, 43.52, 81.23, 
    136.68, NA, NA, 97.58, 94.02, 35.85, 43.46, 37.09, 30.56, 
    47.42, 33.8, NA, 50.24, NA, 52.46, 91.07, 80.82, 54.65, 53.45, 
    136.8, 268.49, 34.27, 51.7, 64.98, 26.69, 49.05, 45.86, 55.42, 
    23.63, 35.08, 57.1, NA, 57.96, 73.85, NA, NA, NA, NA, 29.73, 
    27.01, 37.34, 37.62, 31.54, 37.81, 32.45, 46.62, 26.16, 45.61, 
    62.53, 16.96, 15.21, 66.48, NA, 39.53, 32.19, 29.93, 26.47, 
    23.7, 34.32, 37.43, 25.46, 45.94, 60.03, NA, 137.3, 53.73, 
    106.33, 145.1, 128.23, 22.99, 24.3, 22.23, 28.63, NA, 50.28, 
    NA, NA, NA, 41.35, NA, 61.14, 42.79, 59.5, 67.9, 118.62, 
    101.19, 83.31, 63.48, 159.24, NA, 59.93, NA, 31.98, 55.21, 
    194.78, 83.33, 99.9, 43.49, NA, NA, 63.06, 75.58, 57.73, 
    47.19, 68.38, 51.66, 32.81, 66.9, 141.25, 90.14, NA, 79.84, 
    88.02, 126.06, 190.97, NA, 57.97, NA, NA, 153.03, 77.65, 
    78.88, 69.21, 76.01, 56.54, 58.94, 47.84, 70.01, 64.15, 126.06, 
    104.94, 36.15, 164.29, NA, NA, 143.72, 27.21, 126.88, 114.57, 
    69.42, 102.7, 64.32, 104.28, 51.24, 74.27, 59.81, 109.36, 
    84.11, NA, 97.63, NA, NA, 125.11, 104.41, 41.61, 75.87, 174.93, 
    64.15, 23.79, 38.22, 43.53, 38.36, NA, 94.5, 76, 34.04, NA, 
    27.64, 47.62, NA, 85.88, NA, 117.8, 135.7, 27.52, 28.67, 
    21.78, 18.37, 31.7, 18.1, 38.34, 63.59, 35.36, 29.3, 20.73, 
    47.49, 64.2, 14.87, NA, 36.98, 37.72), Area_av = c(4.042, 
    5.591, 5.09, 4.233, 3.17, NA, NA, 5.248, NA, NA, 10.137, 
    4.352, 8.123, 13.668, NA, NA, 9.758, 9.402, 3.585, 4.346, 
    3.709, 3.056, 4.742, 3.38, NA, 5.024, NA, 5.246, 9.107, 8.082, 
    5.465, 5.345, 13.68, 26.849, 3.427, 5.17, 6.498, 2.669, 4.905, 
    4.586, 5.542, 2.363, 3.508, 5.71, NA, 5.796, 7.385, NA, NA, 
    NA, NA, 2.973, 2.701, 3.734, 3.762, 3.154, 3.781, 3.245, 
    4.662, 2.616, 4.561, 6.253, 1.696, 1.521, 6.648, NA, 3.953, 
    3.219, 2.993, 2.647, 2.37, 3.432, 3.743, 2.546, 4.594, 6.003, 
    NA, 13.73, 5.373, 10.633, 14.51, 12.823, 2.299, 2.43, 2.223, 
    2.863, NA, 5.028, NA, NA, NA, 4.135, NA, 6.114, 4.279, 5.95, 
    6.79, 11.862, 10.119, 8.331, 6.348, 15.924, NA, 5.993, NA, 
    3.198, 5.521, 19.478, 8.333, 9.99, 4.349, NA, NA, 6.306, 
    7.558, 5.773, 4.719, 6.838, 5.166, 3.281, 6.69, 14.125, 9.014, 
    NA, 7.984, 8.802, 12.606, 19.097, NA, 5.797, NA, NA, 15.303, 
    7.765, 7.888, 6.921, 7.601, 5.654, 5.894, 4.784, 7.001, 6.415, 
    12.606, 10.494, 3.615, 16.429, NA, NA, 14.372, 2.721, 12.688, 
    11.457, 6.942, 10.27, 6.432, 10.428, 5.124, 7.427, 5.981, 
    10.936, 8.411, NA, 9.763, NA, NA, 12.511, 10.441, 4.161, 
    7.587, 17.493, 6.415, 2.379, 3.822, 4.353, 3.836, NA, 9.45, 
    7.6, 3.404, NA, 2.764, 4.762, NA, 8.588, NA, 11.78, 13.57, 
    2.752, 2.867, 2.178, 1.837, 3.17, 1.81, 3.834, 6.359, 3.536, 
    2.93, 2.073, 4.749, 6.42, 1.487, NA, 3.698, 3.772), SLA = c(0.08962306, 
    0.094538383, 0.08597973, 0.088723538, 0.091565569, NA, NA, 
    0.097059367, NA, NA, 0.14833187, 0.120956087, 0.14471762, 
    0.193927355, NA, NA, 0.152994669, 0.125259792, 0.121897314, 
    0.093825561, 0.08601577, 0.081449893, 0.085611121, 0.098027842, 
    NA, 0.104535997, NA, 0.108860759, 0.112487648, 0.1269956, 
    0.093707133, 0.126508876, 0.106641721, 0.174298883, 0.096508026, 
    0.083373649, 0.086478573, 0.079934112, 0.089084635, 0.095521766, 
    0.116624579, 0.116346627, 0.145560166, 0.115844999, NA, 0.107036011, 
    0.127415459, NA, NA, NA, NA, 0.089359784, 0.088009123, 0.085819352, 
    0.09, 0.089960068, 0.108121247, 0.134424192, 0.12552504, 
    0.128550369, 0.133675264, 0.13599391, 0.112392313, 0.107719547, 
    0.146238451, NA, 0.076165703, 0.069584955, 0.078125816, 0.084138589, 
    0.077299413, 0.113492063, 0.109125364, 0.109129876, 0.101772264, 
    0.091957721, NA, 0.0966085, 0.119479653, 0.089510902, 0.102995457, 
    0.088691382, 0.095078577, 0.093533487, 0.097929515, 0.097347841, 
    NA, 0.085510204, NA, NA, NA, 0.119994196, NA, 0.154277063, 
    0.140525452, 0.148638521, 0.137088633, 0.120561033, 0.127219009, 
    0.113208316, 0.088326144, 0.085484217, NA, 0.084886686, NA, 
    0.076179133, 0.103408878, 0.092854078, 0.111388852, 0.098239748, 
    0.085224378, NA, NA, 0.123963043, 0.16814238, 0.12184466, 
    0.106982544, 0.131121764, 0.085942439, 0.091367307, 0.07971878, 
    0.104312828, 0.083952687, NA, 0.09889756, 0.096799736, 0.099479167, 
    0.090873186, NA, 0.10513239, NA, NA, 0.121010596, 0.109690634, 
    0.129971989, 0.102079646, 0.113702319, 0.071003391, 0.066426237, 
    0.069023229, 0.073354987, 0.076642772, 0.091666667, 0.093596147, 
    0.096220389, 0.090224614, NA, NA, 0.07277699, 0.102640513, 
    0.147022016, 0.118676196, 0.148842196, 0.100009738, 0.082334869, 
    0.081214953, 0.086408094, 0.088154303, 0.086268571, 0.091568283, 
    0.090382549, NA, 0.096845551, NA, NA, 0.133407976, 0.110463394, 
    0.090911077, 0.096698955, 0.095459754, 0.08182398, 0.092893401, 
    0.094510386, 0.095881057, 0.090089244, NA, 0.172634271, 0.124061378, 
    0.119480519, NA, 0.111541566, 0.134977324, NA, 0.13420847, 
    NA, 0.10948973, 0.106943022, 0.083091787, 0.083053302, 0.085545954, 
    0.098025614, 0.098477788, 0.106470588, 0.138712012, 0.106426778, 
    0.130962963, 0.131626235, 0.11465708, 0.108498972, 0.187445255, 
    0.126768968, NA, 0.139441931, 0.110260158)), class = "data.frame", row.names = c(NA, 
-204L))
strengejacke commented 4 years ago

Given that

Eta2 = SSeffect / SStotal

and the intercept has a very large SSeffect, I don't see something suspicious here related to anova_stats(). Maybe it's rather the car::Anova() command? Or maybe the values are indeed ok?

eimichae commented 4 years ago

Hi, Thank you very much for your response and your explanation. I think the main problem is that the type 3 Anova (car package) also provides an SSeffect for the intercept term (but it does not do that for the type 2 Anova, neither does the "anova()" base command introduce an intercept term). That seems to massively affect the outcome of the results since anova_stats() takes also the SSeffect of the intercept into account.

strengejacke commented 4 years ago

Ok, so you suggest ignoring the intercept when calculating eta-squared?

eimichae commented 4 years ago

Yes, I think I would ignore the intercept term in case of subjecting a type 3 Anova to anova_stats().