Description Usage Arguments Examples
This function uses a binomial GLM and a log-normal GLM to compute a delta-lognormal index of abundance with associated 95 strapping the data. A dummy variable for year must be included to get the annual abundance index. The function back-transforms the index and the CI's.
1 2 | ## S3 method for class 'glm.bindex'
predict(pa.model, cpue.model, boot_reps = 500)
|
pa.model |
binomial GLM predicting presence or absence |
cpue.model |
log-normal GLM predicting abundance where catch is positive |
boot_reps |
number of bootstrap replications (default = 500) |
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.bindex(pa.glm,cpue.glm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.