1 / 68

Now you DO think quite a bit!

Now you DO think quite a bit!. And you drive quite independently!. Mini Reports. Purpose: Stop and realize what you have done in R. Biologically interpret results. Instead of compulsory attendance. Correct severe misstakes or misconceptions. Additional benefit:

iliana
Download Presentation

Now you DO think quite a bit!

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. Now you DO think quite a bit! And you drive quite independently!

  2. Mini Reports • Purpose: • Stop and realize what you have done in R. • Biologically interpret results. • Instead of compulsory attendance. • Correct severe misstakes or misconceptions. • Additional benefit: • You are trained in writing scientifically. • They ARE getting better! Can you feel that?!

  3. Save your code! • Compile your own manuals! • Be able to redo graphs and analyses in seconds! • Use word or Notepad++. • Remember history(Inf) # Correlated x-variabels x11() par(mfrow=c(1,2),mar=c(5,5,2,1)) plot(y~xcont,pch=19,col=c("green2","darkslategray")[xcat],cex=2,cex.axis=1.8,cex.lab=1.8,xlab="Tree size (circumference in cm)",ylab="Lichen size (diameter in cm)",main=paste("Variance Inflation Factor = ",signif(vif(mod.both)[1],2))) abline(lm(y[xcat=="Non-polluted"]~xcont[xcat=="Non-polluted"]), lwd=2,col="green2") abline(lm(y[xcat=="Polluted"]~xcont[xcat=="Polluted"]), lwd=2,col="darkslategray") legend("topright", c("Clean air","Polluted air"), lwd=2,pch=19,col=c("green2","darkslategray"),cex=1.5) stripchart(xcont~xcat,method="jitter",jitter=0.1,vertical=T,pch="",cex=1.5,cex.axis=1.8,cex.lab=1.8,ylab="Tree size") points(xcont~jitter(as.numeric(xcat),.3),col=c("green2","darkslategray")[xcat],pch=19,cex=1.5) medel<-tapply(xcont,xcat,mean) s<-tapply(xcont,xcat,sd) n<-tapply(xcont,xcat,length) a<-length(levels(xcat)) konf<-c(qt(0.975,(n-1))*(s/sqrt(n))) segments(1:a-.05,medel, 1:a+.05,medel, col="red",lwd=8, lend=2) arrows(1:a,medel+konf,1:a,medel-konf,angle=90,code=3,length=.1, col="red",lwd=2)

  4. Example Isoëtes

  5. 6560000 6558000 north 6556000 6554000 6552000 Isoëtes Presence Absence 1582000 1584000 1586000 1588000 1590000 1592000 east

  6. m3 <- Isoëtes ~ log(area) + conn mint <- Isoëtes ~ log(area) + conn + log(area):conn

  7. m3 <- Isoëtes ~ log(area) + conn mint <- Isoëtes ~ log(area) + conn + log(area):conn p = 0.68

  8. m3 <- Isoëtes ~ log(area) + conn mint <- Isoëtes ~ log(area) + conn + log(area):conn p = 0.68

  9. m3 <- Isoëtes ~ log(area) + conn mint <- Isoëtes ~ log(area) + conn + log(area):conn m3 <- Isoëtes ~ log(area) + conn m1 <- Isoëtes ~ log(area) p = 0.68

  10. m3 <- Isoëtes ~ log(area) + conn mint <- Isoëtes ~ log(area) + conn + log(area):conn m3 <- Isoëtes ~ log(area) + conn m1 <- Isoëtes ~ log(area) p = 0.68 p = 0.036

  11. m3 <- Isoëtes ~ log(area) + conn mint <- Isoëtes ~ log(area) + conn + log(area):conn m3 <- Isoëtes ~ log(area) + conn m1 <- Isoëtes ~ log(area) p = 0.68 p = 0.036

  12. m3 <- Isoëtes ~ log(area) + conn mint <- Isoëtes ~ log(area) + conn + log(area):conn m3 <- Isoëtes ~ log(area) + conn m1 <- Isoëtes ~ log(area) m3 <- Isoëtes ~ log(area) + conn m2 <- Isoëtes ~ conn p = 0.68 p = 0.036

  13. m3 <- Isoëtes ~ log(area) + conn mint <- Isoëtes ~ log(area) + conn + log(area):conn m3 <- Isoëtes ~ log(area) + conn m1 <- Isoëtes ~ log(area) m3 <- Isoëtes ~ log(area) + conn m2 <- Isoëtes ~ conn p = 0.68 p = 0.036 p < 0.0001

  14. m3 <- Isoëtes ~ log(area) + conn mint <- Isoëtes ~ log(area) + conn + log(area):conn m3 <- Isoëtes ~ log(area) + conn m1 <- Isoëtes ~ log(area) m3 <- Isoëtes ~ log(area) + conn m2 <- Isoëtes ~ conn p = 0.68 p = 0.036 p < 0.0001

  15. m3 <- Isoëtes ~ log(area) + conn mint <- Isoëtes ~ log(area) + conn + log(area):conn m3 <- Isoëtes ~ log(area) + conn m1 <- Isoëtes ~ log(area) m3 <- Isoëtes ~ log(area) + conn m2 <- Isoëtes ~ conn m3 <- Isoëtes ~ log(area) + conn p = 0.68 p = 0.036 p < 0.0001

  16. Isoëtes ~ area Isoëtes ~ conn

  17. m3 <- Isoëtes ~ log(area) + conn mint <- Isoëtes ~ log(area) + conn + log(area):conn m3 <- Isoëtes ~ log(area) + conn m1 <- Isoëtes ~ log(area) m3 <- Isoëtes ~ log(area) + conn m2 <- Isoëtes ~ conn m1 <- Isoëtes ~ log(area) m0 <- Isoëtes ~ 1 m2 <- Isoëtes ~ conn m0 <- Isoëtes ~ 1 p = 0,68 p = 0,036 p < 0,0001 p < 0,0001 p = 0,82

  18. Isoëtes ~ area Isoëtes ~ litoral.area

  19. Xanthoria reproduction again

  20. Xanthoria reproduction again

  21. Xanthoria reproduction again

  22. Xanthoria reproduction again

  23. Anova table on logged Xanthoria Anova(log.mod) Response: log.apo Sum Sq Df F value Pr(>F) log.lich.mm 6.6403 1 27.5230 7.066e-06 *** species 7.5111 1 31.1324 2.535e-06 *** log.lich.mm:species 0.8477 1 3.5134 0.06901 . Residuals 8.6855 36

  24. Xanthoria reproduction again

  25. Anodev table on poisson Xanthoria poimod<-glm(apo~lich.mm*species,poisson) Anova(poimod) Response: apo LR Chisq Df Pr(>Chisq) lich.mm 1199.50 1 < 2.2e-16 *** species 166.93 1 < 2.2e-16 *** lich.mm:species 18.22 1 1.967e-05 ***

  26. summary table on poisson Xanth poimod<-glm(apo~lich.mm*species,poisson) summary(poimod) … … Residual deviance: 703.65 on 36 degrees of freedom

  27. Anodev table on quasipoisson Xan qpoimod<-glm(apo~lich.mm*species,quasipoisson) Anova(qpoimod,test=”F”) Response: apo LR Chisq Df Pr(>Chisq) lich.mm 49.416 1 2.071e-12 *** species 6.877 1 0.008731 ** lich.mm:species 0.751 1 0.386270

  28. quasipoisson fit on Xanthoria

  29. Anova table on logged Xanthoria Anova(log.mod) Response: log.apo Sum Sq Df F value Pr(>F) log.lich.mm 6.6403 1 27.5230 7.066e-06 *** species 7.5111 1 31.1324 2.535e-06 *** log.lich.mm:species 0.8477 1 3.5134 0.06901 . Residuals 8.6855 36

  30. Xanthoria reproduction again

  31. Curvilinjear relationships

  32. Curvilinjear relationships y ~ x + x2 Predation ~ no. flowering plants y ~ x log10(no. flowering plants)

  33. Curvilinjear relationships y ~ x + x2 Predation ~ no. flowering plants y ~ x Cred to Petra log10(no. flowering plants)

  34. Organic 1 0.8 0.6 Probability for organic milk 0.4 0.2 Ordinary 0 20 30 40 50 60 Ålder Age and organic milk

  35. Organic 1 0.8 0.6 Probability for organic milk 0.4 0.2 Ordinary 0 20 30 40 50 60 Ålder Age and organic milk p = 0.016

  36. Break? or?

  37. MANY response variables • Multivariate statistics • Example: • Do people have different values in different countries? • ”Values” is composed of many response variables: • How important is a high salary? • How important is religion? • Do men and women have the same responsibility for children? etc…

  38. 2.0 Japan Sweden 1.5 East Germany Estonia Norway Bulgaria China Czech Russia West Germany 1.0 Denmark S Korea Ukraine Netherlands Lithuania Finland Slovenia Montenegro Switzerland Taiwan Latvia Greece 0.5 Serbia France Albania Slovakia Luxembourg Moldova Iceland Hungary Belgium Austria Israel Italy Great Britain Bosnia 0 Croatia Spain New Zealand Georgia Azerbadzjan Canada Armenia Uruguay Australia Romania -0.5 Poland N.Ireland U.S.A India Vietnam Turkey -1.0 Portugal Ireland Indonesia Chile Argentina Phillipines Bangladesh Dominican republic Iran Peru South Africa -1.5 Pakistan Brazil Jordan Uganda Mexico Ghana Nigeria Zimbabwe Algeria Egypt Venezuela Morocco Tanzania Colombia -2.0 Puerto Rico El Salvador -2.0 -1.5 -1.0 -0.5 0 0.5 1.0 1.5 2.0

  39. How the **** do you make such a graph? • Making 2D of 3D: • A very simple example: • Which countries are closest to each other? • Values based on: • How important is money? (from 1-5, mean per country) • How important is religion? (from 1-5, mean per country) • How important is gender equality? (from 1-5, mean per country)

  40. PC1

  41. PC 1

  42. PC 1 PC 2

More Related