1 / 80

Copy-paste! …but… T H I N K !

Copy-paste! …but… T H I N K !. Should you log your lichen sizes?. Does it look so bad that your test may be incorrect? – Naa, probably not. Does a log transformation improve the model assumptions? – Yes, but very little!

burton
Télécharger la présentation

Copy-paste! …but… T H I N K !

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Copy-paste! …but… T H I N K !

  2. Should you log your lichen sizes? • Does it look so bad that your test may be incorrect? – Naa, probably not. • Does a log transformation improve the model assumptions? – Yes, but very little! • Does it make biological sence with a percent increase? – Well, I guess so. • OK, let’s use the logged values! • or • Well then let's stick to raw values, they are easier to understand!

  3. stripchart(xcont~xcat,method="jitter",jitter=0.1, vertical=T,pch="") points(xcont~jitter(as.numeric(xcat),.3), col=c("green","gray")[xcat],pch=19)

  4. 5 possible models • Lichen size only depends on the total mean. • Lichen size depends on what site the lichen grows (city vs university). • Lichen size depends on the tree size (≈ age?). • Lichen size depends both on site AND tree size. • Lichen size depends on tree size, but the relationship between tree size and lichen size differs between the sites (city / univ).

  5. m.both <- lich ~ tree + air m.int <- lich ~ tree + air + tree:air m.both <- lich ~ tree + air m.xcont <- lich ~ tree m.both <- lich ~ tree + air m.xcat <- lich ~ air m.xcat <- lich ~ air m.null <- lich ~ 1 m.xcont <- lich ~ tree m.null <- lich ~ 1 p = 0,998 p < 0,0001 p = 0,60 p < 0,0001 p = 0,38

  6. Anova table on logged lichens Anova(lm(log.lich~log.tree.circ*air.q)) Sum Sq Df F value Pr(>F) log.tree 0.0179 1 0.2787 0.5996 air.q 3.3048 1 51.3784 1.827e-09 *** ltre:air 5.583e-07 1 8.680e-06 0.9977 Residuals 3.6020 56

  7. m.both <- lich ~ tree + air m.int <- lich ~ tree + air + tree:air m.both <- lich ~ tree + air m.xcont <- lich ~ tree m.both <- lich ~ tree + air m.xcat <- lich ~ air m.xcat <- lich ~ air m.null <- lich ~ 1 m.xcont <- lich ~ tree m.null <- lich ~ 1 p = 0,72 p < 0,0001 p = 0,32 p < 0,0001 p = 0,16

  8. Anova table on lichens Anova(lm(lich.diam~tree.circ*air.q)) Sum Sq Df F value Pr(>F) tree.circ 5.355 1 0.9879 0.3245 air.q 244.703 1 45.1459 1.007e-08 *** tree:air.q 0.721 1 0.1330 0.7167 Residuals 303.535 56

  9. Lichens are smaller close to the road (F=54, p<0.0001, n=60).

  10. Should you log your lichen sizes? • Does it look so bad that your test may be incorrect? – Well, maybe. • Does a log transformation improve the model assumptions? – YES!, but still crap! • Does it make biological sence with a percent increase? – Well, I guess so. • OK, let’s use the logged values!

  11. m.both <- apo ~ lichsize + spec m.int <- apo ~ lichsize + spec + lichsize:spec m.both <- apo ~ lichsize + spec m.xcont <- apo ~ tree m.both <- apo ~ lichsize + spec m.xcat <- apo ~ spec m.xcat <- apo ~ spec m.null <- apo ~ 1 m.xcont <- apo ~ lichsize m.null <- apo ~ 1 p = 0,0014

  12. Anova table on logged values Anova(lm(log.apo~log.size*spec)) Sum Sq Df F value Pr(>F) log.size 2.2672 1 25.7371 4.308e-06 *** spec 0.0116 1 0.1319 0.717744 lsize:spec 0.9916 1 11.2569 0.001404 ** Residuals 5.1092 58

  13. Anova table on raw values Anova(lm(apo~size*spec)) Sum Sq Df F value Pr(>F) size 30242.0 1 58.9163 2.145e-10 *** spec 272.1 1 0.5302 0.46946 size:spec 1778.9 1 3.4657 0.06773 . Residuals 29771.6 58

  14. m.both <- apo ~ lichsize + spec m.int <- apo ~ lichsize + spec + lichsize:spec m.both <- apo ~ lichsize + spec m.xcont <- apo ~ tree m.both <- apo ~ lichsize + spec m.xcat <- apo ~ spec m.xcat <- apo ~ spec m.null <- apo ~ 1 m.xcont <- apo ~ lichsize m.null <- apo ~ 1 p = 0,0055

  15. The effect of lichen size on number of apothecia differs between these two Xanthoria species (F=11, p=0.0014, n=60). In X. parietina small specimens have very few apothecia, but large specimens may have several hundred. There is a very strong relationship to lichen size (t=7.3, p<0.0001, n=29) In X. polycarpa also very small specimens have many apothecia (~20). There is no strong relationship to lichen size (t=0.90, p=0.38, n=31), and not even the largest specimens have more than 100 fruit bodies.

  16. F-tool (Anova) library(car) Anova(lm(Lichen.diameter~Tree.spec*Tree.size)) Sum Sq Df F value Pr(>F) Tree.spec 140.171 2 44.7051 8.092e-11 *** Tree.size 0.471 1 0.3007 0.586563 Tree.spec:Tree.size 25.240 2 8.0499 0.001184 ** Residuals 61.142 39

  17. Lichen size ~ Tree species

  18. Anova table on logged lichens Anova(lm(log.lich.diam~tree.spec)) Response: log.lich.diam Sum Sq Df F value Pr(>F) tree.spec 0.6578 2 4.4411 0.01613 * Residuals 4.2215 57

  19. Post Hoc Tests • Lichens on tree species • Moss on microsubstrates: stones, stumps, and bare soil • Which differs? • Why not several t-tests (= 2 group anovas)? • Use pooled variance! • Some Bonferroni correction! • TukeyHSD(y~xcat)

  20. Anova table on logged lichens TukeyHSD(aov(log.lich.diam~tree.spec)) diff lwr upr p adj maple-birch 0.23552950 0.04443469 0.42662430 0.0120632 oak-birch 0.09037386 -0.13515029 0.31589802 0.6022177 oak-maple -0.14515563 -0.37239582 0.08208456 0.2814361

  21. Lichen size ~ Tree species

  22. F-tool (Anova) library(car) Anova(lm(Lichen.diameter~Tree.spec*Tree.size)) Sum Sq Df F value Pr(>F) Tree.spec 140.171 2 44.7051 8.092e-11 *** Tree.size 0.471 1 0.3007 0.586563 Tree.spec:Tree.size 25.240 2 8.0499 0.001184 ** Residuals 61.142 39

  23. t-tool (estimates) summary(lm(Lichen.diameter~Tree.spec*Tree.size)) Estimate Std. Error t value Pr(>|t|) (Intercept) 2.193079 0.972902 2.254 0.0299 * Tree.spec maple -0.678676 1.780117 -0.381 0.7051 Tree.spec oak 1.303768 1.193018 1.093 0.2812 Tree.size 0.007810 0.009344 0.836 0.4084 Tree.spec maple:Tree.size 0.045758 0.017817 2.568 0.0142 * Tree.spec oak:Tree.size -0.014465 0.010051 -1.439 0.1581

  24. Centre variables Warning 2. Centre continuous variables if you want to get the estimated effect of both their main effects and their interaction! c.moisture<-moisture-mean(moisture) c.nitrogen<-nitrogen-mean(nitrogen) Now the means will be zero which is the same as that the intercept will occur at the mean. And that means that the main effects will be evaluated at the means.

  25. t-tool (centred estimates) summary(lm(Lichen.diameter~Tree.spec*Tree.size)) Estimate Std. Error t value Pr(>|t|) (Intercept) 3.127476 0.380355 8.223 4.79e-10 *** Tree.spec maple 4.796007 0.615270 7.795 1.78e-09 *** Tree.spec oak -0.426938 0.526433 -0.811 0.4223 Tree.size2 0.007810 0.009344 0.836 0.4084 Tree.spec maple:Tree.size2 0.045758 0.017817 2.568 0.0142 * Tree.spec oak:Tree.size2 -0.014465 0.010051 -1.439 0.1581

More Related