predict.glm.index: A function to predict CPUE-index from a delta-lognormal GLM...

Description Usage Arguments Examples

Description

This function uses a binomial GLM and a log-normal GLM to compute a delta-lognormal index of abundance with associated 95 method. A dummy variable for year must be included to get the annual abundance index. The function back-transforms the index and the CI's.

Usage

1
2
## S3 method for class 'glm.index'
predict(pa.model, cpue.model)

Arguments

pa.model

binomial GLM predicting presence or absence

cpue.model

log-normal GLM predicting abundance where catch is positive

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
glm.pa.xvars<-c("inverts","slope","btemp","bdepth")
glm.pa.yvar<-ifelse(PA.data[species.name]>0,1,0)
glm.pa.form <- as.formula(paste("glm.pa.yvar ~", paste(glm.pa.xvars,collapse="+"),"+as.factor(year)",sep=""))
pa.glm <- glm(glm.pa.form, family = binomial, data = PA.data)

CPUE.data<-subset(PA.data,PA.data[species.name]>0)
glm.cpue.yvar<-unlist(log(CPUE.data[species.name]))
glm.cpue.xvars<-c("inverts","slope","btemp","bdepth")
glm.cpue.form <- as.formula(paste("glm.cpue.yvar ~", paste(glm.cpue.xvars,collapse="+"),"+as.factor(year)",sep=""))
cpue.glm <- glm(glm.cpue.form, family = gaussian, data = CPUE.data)

predict.glm.index(pa.glm,cpue.glm)

rooperc4/GLMGAMRF documentation built on May 17, 2019, 1:30 p.m.