60 likes | 189 Views
Rrrrrr…… now we know what it is but how the heck do you use it?. Andrew Trant PPS Arctic - Labrador Highlands Research Group. Become a modele’R’. Using Reel Fish Example: General Linear model > testaov<-aov(N~transect+year,data=fish)) #for an interaction term: transect*year Now try:
E N D
Rrrrrr……now we know what it is but how the heck do you use it? Andrew Trant PPS Arctic - Labrador Highlands Research Group
Become a modele’R’ Using Reel Fish Example: General Linear model >testaov<-aov(N~transect+year,data=fish)) #for an interaction term: transect*year Now try: >summary(testaov) >plot(testaov) >names(testaov)
Continuous ve’R’sus Catagorical Numeric versus Factor Look at the degrees of freedom - something strange… >is.numeric(fish$transect) >is.factor(fish$transect) >as.factor(fish$transect) >fish$transect2<-as.factor(fish$transect) Rerun with: > testaov2<-aov(N~transect2+year,data=fish)
Generalized Linear Model GAUSSIAN >testglm<-glm(N~transect+year,family=gaussian,data=fish) Again, check: >plot(testglm) >summary(testglm)
Generalized Linear Model GAMMA >testglm2<-glm(N~transect+year,family=Gamma,data=fish) Again, check: >plot(testglm2) >summary(testglm2)
A few last t’R’icks Getting more than one plot per graphics window: >par(mfrow=c(2,2))